]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
don't solicit DNS/NBNS servers unless we have neither
authorDaniel Lenski <dlenski@gmail.com>
Sun, 17 May 2020 06:03:48 +0000 (23:03 -0700)
committerDaniel Lenski <dlenski@gmail.com>
Sun, 17 May 2020 20:21:16 +0000 (13:21 -0700)
Saves a CONFREQ/CONFNAK-offer round-trip

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
ppp.c

diff --git a/ppp.c b/ppp.c
index 6cba421b30dc9bf19748ca33a7bb61ccf3d3bbbe..d6fe969281cc54d51a54677b6c67d017a672b28b 100644 (file)
--- a/ppp.c
+++ b/ppp.c
@@ -218,10 +218,8 @@ int openconnect_ppp_new(struct openconnect_info *vpninfo,
        /* Nameservers to request from peer
         * (see https://tools.ietf.org/html/rfc1877#section-1) */
        ppp->solicit_peerns = 0;
-       if (!vpninfo->ip_info.dns[0])
-               ppp->solicit_peerns |= IPCP_DNS0|IPCP_DNS1;
-       if (!vpninfo->ip_info.nbns[0])
-               ppp->solicit_peerns |= IPCP_NBNS0|IPCP_NBNS1;
+       if (!vpninfo->ip_info.dns[0] && !vpninfo->ip_info.nbns[0])
+               ppp->solicit_peerns |= IPCP_DNS0|IPCP_DNS1|IPCP_NBNS0|IPCP_NBNS1;
 
        /* Outgoing IPv4 address and IPv6 interface identifier (64 LSBs),
         * if already configured via another mechanism */