]> git.meshlink.io Git - meshlink/commitdiff
Fixed another bug in late packet handling.
authorGuus Sliepen <guus@tinc-vpn.org>
Mon, 8 Nov 2004 22:30:13 +0000 (22:30 +0000)
committerGuus Sliepen <guus@tinc-vpn.org>
Mon, 8 Nov 2004 22:30:13 +0000 (22:30 +0000)
src/net_packet.c

index 2a3e5f2ef20e14c63a2884d22b10a5b468809bcc..ac0a3db6031bd167201c6cdc5508712ef0d284fb 100644 (file)
@@ -242,8 +242,10 @@ static void receive_udppacket(node_t *n, vpn_packet_t *inpkt)
                }
        }
        
-       n->received_seqno = inpkt->seqno;
-       n->late[(n->received_seqno / 8) % sizeof(n->late)] &= ~(1 << n->received_seqno % 8);
+       n->late[(inpkt->seqno / 8) % sizeof(n->late)] &= ~(1 << inpkt->seqno % 8);
+
+       if(n->received_seqno > inpkt->seqno)
+               n->received_seqno = inpkt->seqno;
                        
        if(n->received_seqno > MAX_SEQNO)
                keyexpires = 0;