]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
Remember the X-CSTP-Base-MTU: value that the server sends back
authorDavid Woodhouse <David.Woodhouse@intel.com>
Fri, 23 Sep 2016 14:32:44 +0000 (15:32 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Fri, 23 Sep 2016 14:32:44 +0000 (15:32 +0100)
We'll want this, for calculating DTLS MTU with PSK-NEGOTIATE.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
cstp.c
openconnect-internal.h

diff --git a/cstp.c b/cstp.c
index 42b70c85f28ff31bb5ec32c2137b71244ea439bd..d2fd4a62d0ac5ade70f2a34655fea323a93f7ade 100644 (file)
--- a/cstp.c
+++ b/cstp.c
@@ -238,6 +238,7 @@ static int start_cstp_connection(struct openconnect_info *vpninfo)
 
  retry:
        calculate_mtu(vpninfo, &base_mtu, &mtu);
+       vpninfo->cstp_basemtu = base_mtu;
 
        reqbuf = buf_alloc();
        buf_append(reqbuf, "CONNECT /CSCOSSLC/tunnel HTTP/1.1\r\n");
@@ -484,6 +485,8 @@ static int start_cstp_connection(struct openconnect_info *vpninfo)
                                             colon);
                                return -EINVAL;
                        }
+               } else if (!strcmp(buf + 7, "Base-MTU")) {
+                       vpninfo->cstp_basemtu = atol(colon);
                } else if (!strcmp(buf + 7, "MTU")) {
                        int cstpmtu = atol(colon);
                        if (cstpmtu > mtu)
index 5a6d60941c0002a27e750b3754ae9eff5ffdc0d8..10cc909af108788680e4deea2c371a68018083ec 100644 (file)
@@ -566,10 +566,11 @@ struct openconnect_info {
        char *ifname;
        char *cmd_ifname;
 
-       int reqmtu, basemtu;
+       int reqmtu, basemtu; /* Local static configured values */
        const char *banner;
 
        struct oc_ip_info ip_info;
+       int cstp_basemtu; /* Returned by server */
 
 #ifdef _WIN32
        long dtls_monitored, ssl_monitored, cmd_monitored, tun_monitored;