From: Paul Mackerras Date: Mon, 26 May 2008 08:33:22 +0000 (+0000) Subject: Fix bug 1732 - using un-acked DNS settings X-Git-Tag: ppp-2.4.7~95 X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=commitdiff_plain;h=2e09ef6886bbf00bc5a9a641110f801e372ffde6 Fix bug 1732 - using un-acked DNS settings This fixes a bug where we could end up using DNS settings that were requested but nacked or rejected. The problem was that ipcp_up was only looking at go->dnsaddr, not at go->req_dns{1,2}. --- diff --git a/pppd/ipcp.c b/pppd/ipcp.c index 98a427c..b7da1f7 100644 --- a/pppd/ipcp.c +++ b/pppd/ipcp.c @@ -40,7 +40,7 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define RCSID "$Id: ipcp.c,v 1.72 2008/03/26 11:34:23 paulus Exp $" +#define RCSID "$Id: ipcp.c,v 1.73 2008/05/26 08:33:22 paulus Exp $" /* * TODO: @@ -1742,6 +1742,10 @@ ipcp_up(f) if (ho->hisaddr != 0) script_setenv("IPREMOTE", ip_ntoa(ho->hisaddr), 1); + if (!go->req_dns1) + go->dnsaddr[0] = 0; + if (!go->req_dns2) + go->dnsaddr[1] = 0; if (go->dnsaddr[0]) script_setenv("DNS1", ip_ntoa(go->dnsaddr[0]), 0); if (go->dnsaddr[1])