[LWIP] update dhcpd: set ip when dhcpd start.
@@ -404,6 +404,20 @@ void dhcpd_start(char* netif_name)
}
}
+ if (1)
+ {
+ extern void set_if(char *netif_name, char *ip_addr, char *gw_addr, char *nm_addr);
+
+ char ip_str[4 * 4 + 1];
+
+ dhcp_stop(netif);
+
+ sprintf(ip_str, "%d.%d.%d.%d", DHCPD_SERVER_IPADDR0, DHCPD_SERVER_IPADDR1, DHCPD_SERVER_IPADDR2, DHCPD_SERVER_IPADDR3);
+ set_if(netif_name, ip_str, "0.0.0.0", "255.255.255.0");
+
+ netif_set_up(netif);
+ }
+
thread = rt_thread_create("dhcpd",
dhcpd_thread_entry, netif,
1024,
