aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Tuexen <tuexen@FreeBSD.org>2026-02-25 13:06:15 +0000
committerMichael Tuexen <tuexen@FreeBSD.org>2026-02-25 13:06:15 +0000
commitf3364d3c8c876074a9a6f68168e5eb8bd60207de (patch)
tree28ae4ef17dcd0702dd5caf4c9594091aa4b78823
parent8d2f910ceb0f1c366bcf2146a5ba1d1074d07933 (diff)
tcp: improve handling of segments in TIME WAIT
The check for excluding duplicate ACKs needs to consider only TH_SYN and TH_FIN. We know that TH_ACK is set and TH_RST is cleared. All other flags, in particular TH_ECE, TH_CWR, and TH_AE needs to be ignored for the check. PR: 292293 Reviewed by: rrs MFC after: 3 days Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D55489
-rw-r--r--sys/netinet/tcp_timewait.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c
index 847598422da5..ba5c90c91e43 100644
--- a/sys/netinet/tcp_timewait.c
+++ b/sys/netinet/tcp_timewait.c
@@ -287,7 +287,7 @@ tcp_twcheck(struct inpcb *inp, struct tcpopt *to, struct tcphdr *th,
/*
* Acknowledge the segment if it has data or is not a duplicate ACK.
*/
- if (thflags != TH_ACK || tlen != 0 ||
+ if ((thflags & (TH_SYN | TH_FIN)) != 0 || tlen != 0 ||
th->th_seq != tp->rcv_nxt || th->th_ack != tp->snd_nxt) {
TCP_LOG_EVENT(tp, th, NULL, NULL, TCP_LOG_IN, 0, tlen, NULL,
true);