Skip to content

Commit

Permalink
Fix memcpy-less DTLS RX so it really doesn't use memcpy().
Browse files Browse the repository at this point in the history
It was receiving into a preallocated packet... then using queue_new_packet()
on that buffer which would allocate and copy to a *new* packet. Doh!

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Dec 14, 2011
1 parent 4b79633 commit 93de39b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dtls.c
Expand Up @@ -462,7 +462,9 @@ int dtls_mainloop(struct openconnect_info *vpninfo, int *timeout)

switch(buf[0]) {
case AC_PKT_DATA:
queue_new_packet(&vpninfo->incoming_queue, buf+1, len-1);
dtls_pkt->len = len - 1;
queue_packet(&vpninfo->incoming_queue, dtls_pkt);
dtls_pkt = NULL;
work_done = 1;
break;

Expand Down

0 comments on commit 93de39b

Please sign in to comment.