X-Git-Url: http://git.meshlink.io/?p=utcp;a=blobdiff_plain;f=utcp.c;h=1b498a2897d0c4063b568040c24804c6235f636d;hp=fceffbd0856b2a383b008bafb7f488f1ae3489fa;hb=0c29e6bb0a943f9d06067628f894495dcc01c5ba;hpb=de87ec33f4c97689d670ea58c48bb0a74d235042 diff --git a/utcp.c b/utcp.c index fceffbd..1b498a2 100644 --- a/utcp.c +++ b/utcp.c @@ -879,10 +879,7 @@ ssize_t utcp_recv(struct utcp *utcp, const void *data, size_t len) { // ackno should not roll back, and it should also not be bigger than what we ever could have sent // (= snd.una + c->sndbuf.used). - if(hdr.ctl & ACK && - ((seqdiff(hdr.ack, c->snd.una + c->sndbuf.used) > 0 && - seqdiff(hdr.ack, c->snd.nxt) > 0) // TODO: simplify this if - || seqdiff(hdr.ack, c->snd.una) < 0)) { + if(hdr.ctl & ACK && (seqdiff(hdr.ack, c->snd.last) > 0 || seqdiff(hdr.ack, c->snd.una) < 0)) { debug("Packet ack seqno out of range, %u <= %u < %u\n", c->snd.una, hdr.ack, c->snd.una + c->sndbuf.used); // Ignore unacceptable RST packets. if(hdr.ctl & RST)