From b2c2dc72bc29bcb01962e76fa02d7aaac4a52355 Mon Sep 17 00:00:00 2001 From: Tomas Hruby Date: Thu, 7 Apr 2011 07:44:27 +0000 Subject: [PATCH] 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 --- servers/lwip/driver.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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; -- 2.44.0