summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbernard <[email protected]>2015-01-31 20:51:21 +0800
committerbernard <[email protected]>2015-01-31 20:51:21 +0800
commit622e6d8238489b04219af34e0377b050a17a4d4c (patch)
tree33b8e97d5e01ce3a4761d786d9ff0891c5abcb87
parent3e31d349eabad05da7dcd0947cfab88a8b2d988a (diff)
[lwIP] Add Router and DNS server information in DHCP server.
-rw-r--r--components/net/lwip_dhcpd/dhcp_server.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/components/net/lwip_dhcpd/dhcp_server.c b/components/net/lwip_dhcpd/dhcp_server.c
index d77448c898..47547a598b 100644
--- a/components/net/lwip_dhcpd/dhcp_server.c
+++ b/components/net/lwip_dhcpd/dhcp_server.c
@@ -318,6 +318,24 @@ static void dhcpd_thread_entry(void *parameter)
*dhcp_opt++ = 0xFF;
*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_opt++ = DHCP_OPTION_LEASE_TIME;
*dhcp_opt++ = 4;