Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix packet allocation length in KMP followon
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Mar 14, 2015
1 parent cdb8b8e commit 98fda82
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion oncp.c
Expand Up @@ -941,14 +941,15 @@ int oncp_mainloop(struct openconnect_info *vpninfo, int *timeout)
and add POLLOUT. As it is, though, it'll just chew CPU time in that
fairly unlikely situation, until the write backlog clears. */
while (1) {
int len = vpninfo->ip_info.mtu;
int len;
int kmp, kmplen, reclen;
int morecoming;
int followon; /* 0 for the first time round, 2 later to skip the length word */

followon = 0;

next_kmp:
len = vpninfo->ip_info.mtu + vpninfo->pkt_trailer;
if (!vpninfo->cstp_pkt) {
vpninfo->cstp_pkt = malloc(sizeof(struct pkt) + len);
if (!vpninfo->cstp_pkt) {
Expand Down

0 comments on commit 98fda82

Please sign in to comment.