X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fnet_packet.c;h=c0be8c4de2f074538041c03d89639025403e0927;hb=eef25266cb862b5e2c24450d158d99e3cb43e511;hp=81ca70a4c97031a6f13664770592d67b150d92ca;hpb=6bc5d626a8726fc23365ee705761a3c666a08ad4;p=tinc diff --git a/src/net_packet.c b/src/net_packet.c index 81ca70a4..c0be8c4d 100644 --- a/src/net_packet.c +++ b/src/net_packet.c @@ -365,6 +365,8 @@ static void receive_udppacket(node_t *n, vpn_packet_t *inpkt) { if(inpkt->seqno > n->received_seqno) n->received_seqno = inpkt->seqno; + n->received++; + if(n->received_seqno > MAX_SEQNO) regenerate_key(); @@ -739,11 +741,11 @@ bool receive_sptps_record(void *handle, uint8_t type, const char *data, uint16_t int offset = (type & PKT_MAC) ? 0 : 14; if(type & PKT_COMPRESSED) { - len = uncompress_packet(inpkt.data + offset, (const uint8_t *)data, len, from->incompression); - if(len < 0) { + length_t ulen = uncompress_packet(inpkt.data + offset, (const uint8_t *)data, len, from->incompression); + if(ulen < 0) { return false; } else { - inpkt.len = len + offset; + inpkt.len = ulen + offset; } if(inpkt.len > MAXSIZE) abort();