[lwIP] Add Router and DNS server information in DHCP server.

This commit is contained in:
bernard 2015-01-31 20:51:21 +08:00
parent 3e31d349ea
commit 622e6d8238
1 changed files with 18 additions and 0 deletions

View File

@ -318,6 +318,24 @@ static void dhcpd_thread_entry(void *parameter)
*dhcp_opt++ = 0xFF; *dhcp_opt++ = 0xFF;
*dhcp_opt++ = 0x00; *dhcp_opt++ = 0x00;
#ifdef DHCPD_USING_ROUTER
// DHCP_OPTION_ROUTER
*dhcp_opt++ = DHCP_OPTION_ROUTER;
*dhcp_opt++ = 4;
*dhcp_opt++ = DHCPD_SERVER_IPADDR0;
*dhcp_opt++ = DHCPD_SERVER_IPADDR1;
*dhcp_opt++ = DHCPD_SERVER_IPADDR2;
*dhcp_opt++ = 1;
#endif
// DHCP_OPTION_DNS_SERVER, use the default DNS server address in lwIP
*dhcp_opt++ = DHCP_OPTION_DNS_SERVER;
*dhcp_opt++ = 4;
*dhcp_opt++ = 208;
*dhcp_opt++ = 67;
*dhcp_opt++ = 222;
*dhcp_opt++ = 222;
// DHCP_OPTION_LEASE_TIME // DHCP_OPTION_LEASE_TIME
*dhcp_opt++ = DHCP_OPTION_LEASE_TIME; *dhcp_opt++ = DHCP_OPTION_LEASE_TIME;
*dhcp_opt++ = 4; *dhcp_opt++ = 4;