From ad922ae9f76d85293bd9f2277ce3b867ef49a93d Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Mon, 11 Jun 2012 13:47:24 +0100 Subject: [PATCH] Make --disable-ipv6 really do it Previously, it only made us stop *asking* the server for IPv6. If the server gave us IPv6 addresses anyway on the basis that this is the 21st century and there's no excuse for pretending otherwise (or, in practice, because my test server is handing out hard-coded responses without looking at the request), we were still actually using them. Signed-off-by: David Woodhouse --- cstp.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/cstp.c b/cstp.c index ff0eba3e..ab5eba9a 100644 --- a/cstp.c +++ b/cstp.c @@ -356,14 +356,16 @@ static int start_cstp_connection(struct openconnect_info *vpninfo) if (mtu > vpninfo->mtu) vpninfo->mtu = mtu; } else if (!strcmp(buf + 7, "Address")) { - if (strchr(new_option->value, ':')) - vpninfo->vpn_addr6 = new_option->value; - else + if (strchr(new_option->value, ':')) { + if (!vpninfo->disable_ipv6) + vpninfo->vpn_addr6 = new_option->value; + } else vpninfo->vpn_addr = new_option->value; } else if (!strcmp(buf + 7, "Netmask")) { - if (strchr(new_option->value, ':')) - vpninfo->vpn_netmask6 = new_option->value; - else + if (strchr(new_option->value, ':')) { + if (!vpninfo->disable_ipv6) + vpninfo->vpn_netmask6 = new_option->value; + } else vpninfo->vpn_netmask = new_option->value; } else if (!strcmp(buf + 7, "DNS")) { int j;