Marking potential late packets was in the wrong place.
authorGuus Sliepen <guus@tinc-vpn.org>
Mon, 20 Sep 2004 20:55:49 +0000 (20:55 +0000)
committerGuus Sliepen <guus@tinc-vpn.org>
Mon, 20 Sep 2004 20:55:49 +0000 (20:55 +0000)
src/net_packet.c

index 1ae72e16b9890f0b8d34ea786441cb2c11eb9836..2a3e5f2ef20e14c63a2884d22b10a5b468809bcc 100644 (file)
@@ -234,9 +234,11 @@ static void receive_udppacket(node_t *n, vpn_packet_t *inpkt)
                        if(inpkt->seqno <= n->received_seqno - sizeof(n->late) * 8 || !(n->late[(inpkt->seqno / 8) % sizeof(n->late)] & (1 << inpkt->seqno % 8))) {
                                logger(LOG_WARNING, _("Got late or replayed packet from %s (%s), seqno %d, last received %d"),
                                           n->name, n->hostname, inpkt->seqno, n->received_seqno);
-                       } else
-                               for(i = n->received_seqno + 1; i < inpkt->seqno; i++)
-                                       n->late[(inpkt->seqno / 8) % sizeof(n->late)] |= 1 << i % 8;
+                               return;
+                       }
+               } else {
+                       for(i = n->received_seqno + 1; i < inpkt->seqno; i++)
+                               n->late[(inpkt->seqno / 8) % sizeof(n->late)] |= 1 << i % 8;
                }
        }