stun

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

commit 3f1e4aa56e270874e4e353889bb60f0e329669f1
parent fdb2614d39bba5ed1d87d1c78700dc371ef1ebce
Author: sin <sin@2f30.org>
Date:   Thu, 31 Mar 2016 15:01:28 +0100

rename pktlen to payloadlen

Diffstat:
Mstun.c | 18+++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/stun.c b/stun.c @@ -497,7 +497,7 @@ readnet(int fd, unsigned char *pt, int len) { unsigned char payload[MTU + AES_BLOCK_SIZE]; unsigned char hdr[HDRLEN], iv[IVLEN], tag[TAGLEN]; - int n, pktlen; + int n, payloadlen; #define CHECKERR(n) do { \ if ((n) == 0) { \ @@ -518,18 +518,18 @@ readnet(int fd, unsigned char *pt, int len) n = readall(fd, hdr, HDRLEN); CHECKERR(n); - pktlen = unpack16(hdr); - if (pktlen > sizeof(payload)) - pktlen = sizeof(payload); + payloadlen = unpack16(hdr); + if (payloadlen > sizeof(payload)) + payloadlen = sizeof(payload); - n = readall(fd, payload, pktlen); + n = readall(fd, payload, payloadlen); CHECKERR(n); - pktlen = aesdec(&dctx, pt, payload, pktlen, aeskey, iv, hdr, HDRLEN, - tag, TAGLEN); - if (pktlen < 0) + payloadlen = aesdec(&dctx, pt, payload, payloadlen, aeskey, iv, + hdr, HDRLEN, tag, TAGLEN); + if (payloadlen < 0) return BADPKT; - return pktlen; + return payloadlen; } int