mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-26 01:57:01 +08:00
PPP, DNS: introduce ppp_set_usepeerdns macro
PPP use peer DNS setting is currently hardcoded to true if PPP is acting as a client and set to false if PPP is actinf as a server. This is probably the most wanted behavior, but since we now have the ability to change that at runtime, allow users to do it. We don't have a way to have a different default configuration if the PPP PCB is going to be used as a client or as a server, therefore the default configuration should be fine for both of them. Since enabling peer DNS by default is dangerous for server mode, the default is now not to ask for DNS servers and it should now be explicitely enabled if needed, update the documentation accordingly.
This commit is contained in:
@@ -466,6 +466,12 @@ void ppp_set_auth(ppp_pcb *pcb, u8_t authtype, const char *user, const char *pas
|
||||
* for PPP server support.
|
||||
*/
|
||||
#define ppp_set_ipcp_dnsaddr(ppp, index, addr) (ppp->ipcp_allowoptions.dnsaddr[index] = ip4_addr_get_u32(addr))
|
||||
|
||||
/*
|
||||
* Whether we ask the peer for up to 2 DNS server addresses. Received DNS server addresses are
|
||||
* registered using the dns_setserver() function. Default is false.
|
||||
*/
|
||||
#define ppp_set_usepeerdns(ppp, boolval) (ppp->settings.usepeerdns = boolval)
|
||||
#endif /* LWIP_DNS */
|
||||
#endif /* PPP_IPV4_SUPPORT */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user