shared/netutils/dhcpserver: Match default DNS to server IP.

Change the default DNS to match the gateway IP of a board running in access
point mode (or otherwise acting as a "server").

This fixes the rather meaningless use of "8.8.8.8" as the default DNS
server address offered up to access point clients via the DHCP server.
Since most devices wont be able to proxy access to the real "8.8.8.8".

It allows for a DNS responder to run and provide a catchall response for
captive portal functionality, or just a quality-of-life response to a
friendly URL for access-point based configuration and other applications.

Signed-off-by: Phil Howard <phil@gadgetoid.com>
pull/5195/merge
Phil Howard 2022-07-07 16:35:45 +01:00 zatwierdzone przez Damien George
rodzic 9f0f7e34c7
commit e1282556e8
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -65,7 +65,7 @@
#define PORT_DHCP_SERVER (67)
#define PORT_DHCP_CLIENT (68)
#define DEFAULT_DNS MAKE_IP4(8, 8, 8, 8)
#define DEFAULT_DNS MAKE_IP4(192, 168, 4, 1)
#define DEFAULT_LEASE_TIME_S (24 * 60 * 60) // in seconds
#define MAC_LEN (6)