From: Guus Sliepen Date: Fri, 5 Dec 2014 21:10:37 +0000 (+0100) Subject: Send ACKs without a payload upon receiving an out-of-order packet. X-Git-Url: http://git.meshlink.io/?p=utcp;a=commitdiff_plain;h=2ae2f9bbb7502589f279c329815d55ec526baffd Send ACKs without a payload upon receiving an out-of-order packet. This is necessary so the peer can detect "triplicate ACKs", which signal dropped packets, and at the same time keeps the TCP self-clocking active. --- diff --git a/utcp.c b/utcp.c index 2ef56ea..db775a9 100644 --- a/utcp.c +++ b/utcp.c @@ -587,12 +587,13 @@ ssize_t utcp_recv(struct utcp *utcp, const void *data, size_t len) { #endif if(!acceptable) { - debug("Packet not acceptable, %u <= %u + %zu < %u\n", c->rcv.nxt, hdr.seq, len, c->rcv.nxt + c->rcv.wnd); + debug("Packet not acceptable, %u <= %u + %zu < %u\n", c->rcv.nxt, hdr.seq, len, c->rcv.nxt + c->rcv.wnd); // Ignore unacceptable RST packets. if(hdr.ctl & RST) return 0; // Otherwise, send an ACK back in the hope things improve. - goto ack; + ack(c, true); + return 0; } c->snd.wnd = hdr.wnd; // TODO: move below