summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_input.c
diff options
context:
space:
mode:
authorjlemon <jlemon@FreeBSD.org>2003-02-26 18:20:41 +0000
committerjlemon <jlemon@FreeBSD.org>2003-02-26 18:20:41 +0000
commitd57f539d00971e49703bb5b1e12f05a1c6cd50fb (patch)
treecd6504ec1d6b1d9d0c466b485cafeb5b53425e1c /sys/netinet/tcp_input.c
parent55ad40591c6b9581452e25fff8526a772449db4f (diff)
downloadFreeBSD-src-d57f539d00971e49703bb5b1e12f05a1c6cd50fb.zip
FreeBSD-src-d57f539d00971e49703bb5b1e12f05a1c6cd50fb.tar.gz
In timewait state, if the incoming segment is a pure in-sequence ack
that matches snd_max, then do not respond with an ack, just drop the segment. This fixes a problem where a simultaneous close results in an ack loop between two time-wait states. Test case supplied by: Tim Robbins <tjr@FreeBSD.ORG> Sponsored by: DARPA, NAI Labs
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r--sys/netinet/tcp_input.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 2fec783..7b4827a 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -2913,9 +2913,11 @@ tcp_timewait(tw, to, th, m, tlen)
}
/*
- * Acknowlege the segment, then drop it.
+ * Acknowledge the segment if it has data or is not a duplicate ACK.
*/
- tcp_twrespond(tw, TH_ACK);
+ if (thflags != TH_ACK || tlen != 0 ||
+ th->th_seq != tw->rcv_nxt || th->th_ack != tw->snd_nxt)
+ tcp_twrespond(tw, TH_ACK);
goto drop;
reset:
OpenPOWER on IntegriCloud