git: 53d8d57fa5e2 - stable/14 - tcp: improve handling of segments in TIME WAIT
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 26 Apr 2026 09:13:52 UTC
The branch stable/14 has been updated by tuexen:
URL: https://cgit.FreeBSD.org/src/commit/?id=53d8d57fa5e2e9eaa03f44c24afddc1f3d09e26d
commit 53d8d57fa5e2e9eaa03f44c24afddc1f3d09e26d
Author: Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2026-02-25 13:06:15 +0000
Commit: Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2026-04-26 07:12:28 +0000
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
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D55489
Event: Wiesbaden Hackathon
(cherry picked from commit f3364d3c8c876074a9a6f68168e5eb8bd60207de)
---
sys/netinet/tcp_timewait.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c
index fbabca5554ba..a833248cd468 100644
--- a/sys/netinet/tcp_timewait.c
+++ b/sys/netinet/tcp_timewait.c
@@ -291,7 +291,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);