[LWIP] update dhcpd: set ip when dhcpd start.

This commit is contained in:
aozima 2017-12-27 20:09:28 +08:00
parent 6fe49b1af7
commit 1215737ec9
1 changed files with 21 additions and 7 deletions

View File

@ -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", thread = rt_thread_create("dhcpd",
dhcpd_thread_entry, netif, dhcpd_thread_entry, netif,
1024, 1024,