Skip to content

Commit

Permalink
Fix setting of IP addresses in ip_info from PPP
Browse files Browse the repository at this point in the history
We were clearing vpninfo->ip_info.addr if it was already set, as shown in
adrienverge/openfortivpn#112 (comment)

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
  • Loading branch information
dwmw2 committed May 4, 2021
1 parent 875a14f commit cefa0aa
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions ppp.c
Expand Up @@ -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)
Expand Down

0 comments on commit cefa0aa

Please sign in to comment.