Skip to content

Commit

Permalink
Merge branch 'obey_IPv6_in_Pulse_and_Fortinet' into 'master'
Browse files Browse the repository at this point in the history
Follow disable_ipv6 for Pulse and Fortinet

See merge request openconnect/openconnect!214
  • Loading branch information
dwmw2 committed Jun 29, 2021
2 parents 5f1c470 + 80e6f8a commit 19752fc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
7 changes: 5 additions & 2 deletions fortinet.c
Expand Up @@ -417,10 +417,13 @@ static int parse_fortinet_xml_config(struct openconnect_info *vpninfo, char *buf
goto out;
}
vpn_progress(vpninfo, PRG_INFO, _("Got IPv6 address %s\n"), a);
new_ip_info.netmask6 = add_option_steal(&new_opts, "ipaddr6", &a);
if (!vpninfo->disable_ipv6)
new_ip_info.netmask6 = add_option_steal(&new_opts, "ipaddr6", &a);
free(a);
} else {
vpn_progress(vpninfo, PRG_INFO, _("Got IPv6 address %s\n"), s);
new_ip_info.addr6 = add_option_steal(&new_opts, "ipaddr6", &s);
if (!vpninfo->disable_ipv6)
new_ip_info.addr6 = add_option_steal(&new_opts, "ipaddr6", &s);
}
} else if (xmlnode_is_named(x, "dns")) {
if (!xmlnode_get_prop(x, "domain", &s) && s && *s) {
Expand Down
11 changes: 6 additions & 5 deletions pulse.c
Expand Up @@ -283,12 +283,13 @@ static int process_attr(struct openconnect_info *vpninfo, struct oc_vpn_option *
_("Failed to handle IPv6 address\n"));
return -EINVAL;
}
new_ip_info->addr6 = add_option_dup(new_opts, "ip6addr", buf, -1);

i = strlen(buf);
snprintf(buf + i, sizeof(buf) - i, "/%d", data[16]);
new_ip_info->netmask6 = add_option_dup(new_opts, "ip6netmask", buf, -1);
if (!vpninfo->disable_ipv6) {
new_ip_info->addr6 = add_option_dup(new_opts, "ip6addr", buf, -1);

i = strlen(buf);
snprintf(buf + i, sizeof(buf) - i, "/%d", data[16]);
new_ip_info->netmask6 = add_option_dup(new_opts, "ip6netmask", buf, -1);
}
vpn_progress(vpninfo, PRG_DEBUG, _("Received internal IPv6 address %s\n"), buf);
break;

Expand Down

0 comments on commit 19752fc

Please sign in to comment.