git: a7cdf5cd9cc6 - stable/14 - tcp: address PR295870
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 16 Nov 2026 12:47:20 UTC
The branch stable/14 has been updated by rscheff:
URL: https://cgit.FreeBSD.org/src/commit/?id=a7cdf5cd9cc6562e828a1723fa4a67c893141d23
commit a7cdf5cd9cc6562e828a1723fa4a67c893141d23
Author: Richard Scheffenegger <rscheff@FreeBSD.org>
AuthorDate: 2026-11-08 15:36:13 +0000
Commit: Richard Scheffenegger <rscheff@FreeBSD.org>
CommitDate: 2026-11-16 12:43:52 +0000
tcp: address PR295870
Fix accounting in the sequence space for a FIN bit potentially
piggy bagged during SACK loss recovery triggered transmissions.
Reviewed By: #transport, tuexen
Sponsored by: NetApp, Inc.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D61312
(cherry picked from commit 0aa6428f463699c5f5e03715ea4ebe2309a23a2d)
---
sys/netinet/tcp_output.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c
index a8e2a18f72da..6da1dbd1ea24 100644
--- a/sys/netinet/tcp_output.c
+++ b/sys/netinet/tcp_output.c
@@ -1197,6 +1197,7 @@ send:
if (flags & TH_FIN && tp->t_flags & TF_SENTFIN &&
tp->snd_nxt == tp->snd_max)
tp->snd_nxt--;
+ KASSERT(SEQ_LEQ(tp->snd_nxt, tp->snd_max), ("SEG_GT(snd_nxt, snd_max)"));
/*
* If we are starting a connection, send ECN setup
* SYN packet. If we are on a retransmit, we may
@@ -1552,8 +1553,16 @@ out:
tp->t_flags |= TF_SENTFIN;
}
}
- if (sack_rxmit)
+ if (sack_rxmit) {
+ /*
+ * Retransmitted bytes are already in snd_max.
+ * A FIN on this segment is not. snd_nxt was
+ * advanced for it above.
+ */
+ if (SEQ_GT(tp->snd_nxt, tp->snd_max))
+ tp->snd_max = tp->snd_nxt;
goto timer;
+ }
tp->snd_nxt += len;
if (SEQ_GT(tp->snd_nxt, tp->snd_max)) {
/*