mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-08-08 08:33:39 +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:
@@ -627,10 +627,6 @@ ppp_pcb *ppp_new(struct netif *pppif, const struct link_callbacks *callbacks, vo
|
||||
memset(pcb, 0, sizeof(ppp_pcb));
|
||||
|
||||
/* default configuration */
|
||||
#if LWIP_DNS
|
||||
pcb->settings.usepeerdns = 1;
|
||||
#endif /* LWIP_DNS */
|
||||
|
||||
#if PAP_SUPPORT
|
||||
pcb->settings.pap_timeout_time = UPAP_DEFTIMEOUT;
|
||||
pcb->settings.pap_max_transmits = UPAP_DEFTRANSMITS;
|
||||
|
||||
@@ -357,11 +357,6 @@ pppos_listen(ppp_pcb *ppp, void *ctx)
|
||||
}
|
||||
#endif /* PPP_AUTH_SUPPORT */
|
||||
|
||||
#if PPP_IPV4_SUPPORT && LWIP_DNS
|
||||
/* Don't accept DNS from peer */
|
||||
ppp->settings.usepeerdns = 0;
|
||||
#endif /* PPP_IPV4_SUPPORT && LWIP_DNS */
|
||||
|
||||
/*
|
||||
* Default the in and out accm so that escape and flag characters
|
||||
* are always escaped.
|
||||
|
||||
Reference in New Issue
Block a user