stun

simple point to point tunnel
git clone git://git.2f30.org/stun
Log | Files | Refs | README

commit 263820648b77b2cdbe04469ad6632f05655d8183
parent 108742310a2606b3cc39511856716aa11976d14b
Author: sin <sin@2f30.org>
Date:   Tue, 12 Apr 2016 14:41:57 +0100

if tag checking fails report a partial packet

Diffstat:
Mnetpkt.c | 6++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/netpkt.c b/netpkt.c @@ -145,10 +145,8 @@ netread(int fd, unsigned char *pt, size_t ptlen, size_t *outlen) rbuftotal += n; rbufrem -= n; } - if (rbufrem == 0) { - rbufrem = taglen; + if (rbufrem == 0) state = STATEOPEN; - } break; case STATEOPEN: state = STATEINITIAL; @@ -157,7 +155,7 @@ netread(int fd, unsigned char *pt, size_t ptlen, size_t *outlen) rbuftotal - noncelen - HDRLEN, &rbuf[noncelen], HDRLEN)) { logwarn("cryptoopen failed"); - return PKTFAILED; + return PKTPARTIAL; } return PKTCOMPLETE; case STATEDISCARD: