From 660311d74d35bd180badf3c2771b73f35bf133d0 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Sun, 28 Dec 2014 09:50:52 +0200 Subject: [PATCH] enable IPv6 in Anyconnect clients, and send the prefix --- src/worker-vpn.c | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/src/worker-vpn.c b/src/worker-vpn.c index cee17fec..1f6f9a0d 100644 --- a/src/worker-vpn.c +++ b/src/worker-vpn.c @@ -1545,16 +1545,8 @@ static int connect_handler(worker_st * ws) } } - /* If we are in CISCO client compatibility mode, do not send - * any IPv6 information, unless the client can really handle it. - */ - if (ws->full_ipv6 == 0 && ws->config->cisco_client_compat != 0 && - req->user_agent_type != AGENT_OPENCONNECT) { - req->no_ipv6 = 1; - } - - if (ws->vinfo.ipv6 && req->no_ipv6 == 0) { - oclog(ws, LOG_DEBUG, "sending IPv6 %s", ws->vinfo.ipv6); + if (ws->vinfo.ipv6 && req->no_ipv6 == 0 && ws->vinfo.ipv6_prefix != 0) { + oclog(ws, LOG_DEBUG, "sending IPv6 %s/%u", ws->vinfo.ipv6, ws->vinfo.ipv6_prefix); if (ws->full_ipv6 && ws->vinfo.ipv6_prefix) { ret = cstp_printf(ws, @@ -1563,16 +1555,8 @@ static int connect_handler(worker_st * ws) SEND_ERR(ret); } else { ret = - cstp_printf(ws, "X-CSTP-Address: %s\r\n", - ws->vinfo.ipv6); - SEND_ERR(ret); - } - - if (ws->vinfo.ipv6_network && ws->vinfo.ipv6_prefix != 0) { - ret = - cstp_printf(ws, - "X-CSTP-Netmask: %s/%u\r\n", - ws->vinfo.ipv6_network, ws->vinfo.ipv6_prefix); + cstp_printf(ws, "X-CSTP-Address: %s/%u\r\n", + ws->vinfo.ipv6, ws->vinfo.ipv6_prefix); SEND_ERR(ret); } }