Skip to content

Commit

Permalink
Remember the X-CSTP-Base-MTU: value that the server sends back
Browse files Browse the repository at this point in the history
We'll want this, for calculating DTLS MTU with PSK-NEGOTIATE.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Sep 23, 2016
1 parent 16fc31a commit 4522837
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions cstp.c
Expand Up @@ -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");
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion openconnect-internal.h
Expand Up @@ -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;
Expand Down

0 comments on commit 4522837

Please sign in to comment.