]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
Only set ip_info addresses from PPP if they aren't already set
authorDavid Woodhouse <dwmw2@infradead.org>
Tue, 27 Apr 2021 23:08:45 +0000 (00:08 +0100)
committerDavid Woodhouse <dwmw2@infradead.org>
Tue, 27 Apr 2021 23:08:45 +0000 (00:08 +0100)
Fortinet reconnection, in particular, didn't like the addr6 being set
because it *isn't* set in the new ip_info we receive in XML; only the
netmask6 is set there.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
ppp.c

diff --git a/ppp.c b/ppp.c
index 672ff17788aa152c6ed082916d03f9319dca27c2..6526b0f262bc7eef8db8511592ee91a9f2ce421b 100644 (file)
--- a/ppp.c
+++ b/ppp.c
@@ -936,7 +936,7 @@ static int handle_state_transition(struct openconnect_info *vpninfo, int dtls,
                ppp->ppp_state = PPPS_NETWORK;
 
                /* Ensure that we use the addresses we configured on PPP */
-               if (ppp->want_ipv4) {
+               if (ppp->want_ipv4 && !vpninfo->ip_info.addr) {
                        vpninfo->ip_info.addr = add_option_ipaddr(&vpninfo->cstp_options, "ppp_ipv4",
                                                                  AF_INET, &ppp->out_ipv4_addr);
                } else {
@@ -944,7 +944,7 @@ static int handle_state_transition(struct openconnect_info *vpninfo, int dtls,
                }
 
                /* Ensure that we use the addresses we configured on PPP */
-               if (ppp->want_ipv6) {
+               if (ppp->want_ipv6 && !vpninfo->ip_info.addr6 && !vpninfo->ip_info.netmask6) {
                        vpninfo->ip_info.addr6 = add_option_ipaddr(&vpninfo->cstp_options, "ppp_ipv6",
                                                                   AF_INET6, &ppp->out_ipv6_addr);
                } else {