Skip to content

Commit 622e6d8

Browse files
committed
[lwIP] Add Router and DNS server information in DHCP server.
1 parent 3e31d34 commit 622e6d8

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

components/net/lwip_dhcpd/dhcp_server.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,24 @@ static void dhcpd_thread_entry(void *parameter)
318318
*dhcp_opt++ = 0xFF;
319319
*dhcp_opt++ = 0x00;
320320

321+
#ifdef DHCPD_USING_ROUTER
322+
// DHCP_OPTION_ROUTER
323+
*dhcp_opt++ = DHCP_OPTION_ROUTER;
324+
*dhcp_opt++ = 4;
325+
*dhcp_opt++ = DHCPD_SERVER_IPADDR0;
326+
*dhcp_opt++ = DHCPD_SERVER_IPADDR1;
327+
*dhcp_opt++ = DHCPD_SERVER_IPADDR2;
328+
*dhcp_opt++ = 1;
329+
#endif
330+
331+
// DHCP_OPTION_DNS_SERVER, use the default DNS server address in lwIP
332+
*dhcp_opt++ = DHCP_OPTION_DNS_SERVER;
333+
*dhcp_opt++ = 4;
334+
*dhcp_opt++ = 208;
335+
*dhcp_opt++ = 67;
336+
*dhcp_opt++ = 222;
337+
*dhcp_opt++ = 222;
338+
321339
// DHCP_OPTION_LEASE_TIME
322340
*dhcp_opt++ = DHCP_OPTION_LEASE_TIME;
323341
*dhcp_opt++ = 4;

0 commit comments

Comments
 (0)