]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
Fix setting of IP addresses in ip_info from PPP
authorDavid Woodhouse <dwmw2@infradead.org>
Mon, 3 May 2021 19:34:16 +0000 (20:34 +0100)
committerDavid Woodhouse <dwmw2@infradead.org>
Tue, 4 May 2021 11:37:20 +0000 (12:37 +0100)
We were clearing vpninfo->ip_info.addr if it was already set, as shown in
https://github.com/adrienverge/openfortivpn/issues/112#issuecomment-831471948

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

diff --git a/ppp.c b/ppp.c
index 18c8de8ce96b50bcb7741220df300ce45cb285b5..37aab0473572bd3867544e4d7f6bc6b58c1e8c01 100644 (file)
--- a/ppp.c
+++ b/ppp.c
@@ -947,16 +947,12 @@ static int handle_state_transition(struct openconnect_info *vpninfo, int dtls,
                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 {
-                       vpninfo->ip_info.addr = NULL;
                }
 
                /* Ensure that we use the addresses we configured on PPP */
                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 {
-                       vpninfo->ip_info.addr6 = NULL;
                }
 
                if (ppp->got_peerns & IPCP_NBNS0)