X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fsptps.c;fp=src%2Fsptps.c;h=54c5a55e61bc27ed7eff8aec95803c4d3181842e;hb=158cbe99f972a1613b7d4d95abfe5fe48e019e67;hp=370883fd0715f579bd4edec4a8c76a44b374648d;hpb=a86faaf34711d6b0f278b670d70a229a3cf0d479;p=meshlink diff --git a/src/sptps.c b/src/sptps.c index 370883fd..54c5a55e 100644 --- a/src/sptps.c +++ b/src/sptps.c @@ -1,7 +1,6 @@ /* sptps.c -- Simple Peer-to-Peer Security - Copyright (C) 2011-2013 Guus Sliepen , - 2010 Brandon L. Black + Copyright (C) 2014 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -437,11 +436,7 @@ static bool sptps_receive_data_datagram(sptps_t *s, const char *data, size_t len if(s->replaywin) { if(seqno != s->inseqno) { if(seqno >= s->inseqno + s->replaywin * 8) { - // Prevent packets that jump far ahead of the queue from causing many others to be dropped. - if(s->farfuture++ < s->replaywin >> 2) - return error(s, EIO, "Packet is %d seqs in the future, dropped (%u)\n", seqno - s->inseqno, s->farfuture); - - // Unless we have seen lots of them, in which case we consider the others lost. + // TODO: Prevent packets that jump far ahead of the queue from causing many others to be dropped. warning(s, "Lost %d packets\n", seqno - s->inseqno); // Mark all packets in the replay window as being late. memset(s->late, 255, s->replaywin); @@ -458,7 +453,6 @@ static bool sptps_receive_data_datagram(sptps_t *s, const char *data, size_t len // Mark the current packet as not being late. s->late[(seqno / 8) % s->replaywin] &= ~(1 << seqno % 8); - s->farfuture = 0; } if(seqno >= s->inseqno)