From: Paul Mackerras Date: Tue, 13 Jan 2004 03:59:06 +0000 (+0000) Subject: Always set the DNS1 and DNS2 environment variables from scripts, X-Git-Tag: ppp-2.4.7~263 X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=commitdiff_plain;h=0edb416a0ad9cf75eaf37896df680333e17a1a52;hp=b289ec4c473338c67bce0cb5712616da2d2493e8 Always set the DNS1 and DNS2 environment variables from scripts, even if we didn't explicitly ask the peer to send them. Patch from Marco d'Itri. --- diff --git a/pppd/ipcp.c b/pppd/ipcp.c index c2a7f27..128c204 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.64 2003/07/28 12:25:41 carlsonj Exp $" +#define RCSID "$Id: ipcp.c,v 1.65 2004/01/13 03:59:06 paulus Exp $" /* * TODO: @@ -1687,12 +1687,12 @@ ipcp_up(f) script_setenv("IPLOCAL", ip_ntoa(go->ouraddr), 0); script_setenv("IPREMOTE", ip_ntoa(ho->hisaddr), 1); + if (go->dnsaddr[0]) + script_setenv("DNS1", ip_ntoa(go->dnsaddr[0]), 0); + if (go->dnsaddr[1]) + script_setenv("DNS2", ip_ntoa(go->dnsaddr[1]), 0); if (usepeerdns && (go->dnsaddr[0] || go->dnsaddr[1])) { script_setenv("USEPEERDNS", "1", 0); - if (go->dnsaddr[0]) - script_setenv("DNS1", ip_ntoa(go->dnsaddr[0]), 0); - if (go->dnsaddr[1]) - script_setenv("DNS2", ip_ntoa(go->dnsaddr[1]), 0); create_resolv(go->dnsaddr[0], go->dnsaddr[1]); }