From: Tomas Hruby Date: Thu, 7 Apr 2011 07:44:27 +0000 (+0000) Subject: LWIP - Fix for dhcpd broadcast to work after boot X-Git-Tag: v3.2.0~590 X-Git-Url: http://zhaoyanbai.com/repos/Bv9ARM.ch01.html?a=commitdiff_plain;h=b2c2dc72bc29bcb01962e76fa02d7aaac4a52355;p=minix.git LWIP - Fix for dhcpd broadcast to work after boot Dhcp only works if devices are configured with a broadcast source address at the begining as it currently uses raw ip sockets and the sockets sets the source address. It is a quick hack and proper hdcpd fix is preferable --- diff --git a/servers/lwip/driver.c b/servers/lwip/driver.c index 6299da79c..fb3657d1c 100644 --- a/servers/lwip/driver.c +++ b/servers/lwip/driver.c @@ -411,7 +411,14 @@ void driver_up(const char * label, endpoint_t ep) nic->state = DRV_IDLE; - if (!netif_add(&nic->netif, &ip_addr_none, &ip_addr_none, &ip_addr_none, + /* + * FIXME + * + * We set the initial ip to 0.0.0.0 to make dhcpd broadcasing work + * at the very begining. dhcp should use raw socket but it is a little + * tricy in the current dhcp implementation + */ + if (!netif_add(&nic->netif, &ip_addr_any, &ip_addr_none, &ip_addr_none, nic, ethernetif_init, ethernet_input)) { printf("LWIP : failed to add device /dev/%s\n", nic->name); nic->drv_ep = NONE;