git: 9e345ca583f7 - main - tcp: improve ISS checking for ghost ACKs
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 24 Nov 2026 17:12:01 UTC
The branch main has been updated by tuexen:
URL: https://cgit.FreeBSD.org/src/commit/?id=9e345ca583f702e7472f836136e766d3346c049d
commit 9e345ca583f702e7472f836136e766d3346c049d
Author: Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2026-11-24 13:45:27 +0000
Commit: Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2026-11-24 13:45:27 +0000
tcp: improve ISS checking for ghost ACKs
The check in tcp_adapt_iss_check() depends on SND.UNA and therefore
should be performed whenever SND.UNA is incremented.
PR: 298560
Reviewed by: Peter Lei
MFC after: 3 days
MFC to: stable/14
MFC to: stable/15
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D61749
---
sys/netinet/tcp_input.c | 3 ++-
sys/netinet/tcp_stacks/bbr.c | 3 ++-
sys/netinet/tcp_stacks/rack.c | 5 ++++-
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 92fd7ae50a50..c5d5b0e25e90 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -1853,6 +1853,7 @@ tcp_do_segment(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th,
cc_ack_received(tp, th, nsegs, CC_ACK);
tp->snd_una = th->th_ack;
+ tcp_adapt_iss_check(tp);
/*
* Pull snd_wl2 up to prevent seq wrap relative
* to th_ack.
@@ -2424,7 +2425,6 @@ tcp_do_segment(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th,
/*
* Ack processing.
*/
- tcp_adapt_iss_check(tp);
if (!V_tcp_insecure_ack) {
tcp_seq seq_min;
bool ghost_ack_check;
@@ -3021,6 +3021,7 @@ process_ACK:
SEQ_LEQ(th->th_ack, tp->snd_recover))
tp->snd_recover = th->th_ack - 1;
tp->snd_una = th->th_ack;
+ tcp_adapt_iss_check(tp);
if (IN_RECOVERY(tp->t_flags) &&
SEQ_GEQ(th->th_ack, tp->snd_recover)) {
cc_post_recovery(tp, th);
diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c
index 1a6d59111494..ce3394e06be7 100644
--- a/sys/netinet/tcp_stacks/bbr.c
+++ b/sys/netinet/tcp_stacks/bbr.c
@@ -7681,7 +7681,6 @@ bbr_process_ack(struct mbuf *m, struct tcphdr *th, struct socket *so,
bbr = (struct tcp_bbr *)tp->t_fb_ptr;
lost = bbr->r_ctl.rc_lost;
nsegs = max(1, m->m_pkthdr.lro_nsegs);
- tcp_adapt_iss_check(tp);
if (!V_tcp_insecure_ack) {
tcp_seq seq_min;
bool ghost_ack_check;
@@ -7801,6 +7800,7 @@ bbr_process_ack(struct mbuf *m, struct tcphdr *th, struct socket *so,
bbr_collapse_rtt(tp, bbr, TCP_REXMTVAL(tp));
}
tp->snd_una = th->th_ack;
+ tcp_adapt_iss_check(tp);
bbr_ack_received(tp, bbr, th, acked, sack_changed, prev_acked, __LINE__, (bbr->r_ctl.rc_lost - lost));
if (IN_RECOVERY(tp->t_flags)) {
if (SEQ_LT(th->th_ack, tp->snd_recover) &&
@@ -8658,6 +8658,7 @@ bbr_fastack(struct mbuf *m, struct tcphdr *th, struct socket *so,
if (SEQ_GT(th->th_ack, tp->snd_una))
bbr_collapse_rtt(tp, bbr, TCP_REXMTVAL(tp));
tp->snd_una = th->th_ack;
+ tcp_adapt_iss_check(tp);
if (tp->snd_wnd < ctf_outstanding(tp))
/* The peer collapsed its window on us */
bbr_collapsed_window(bbr);
diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c
index b4ff35b3acfe..4c000908a0f1 100644
--- a/sys/netinet/tcp_stacks/rack.c
+++ b/sys/netinet/tcp_stacks/rack.c
@@ -11701,7 +11701,6 @@ rack_process_ack(struct mbuf *m, struct tcphdr *th, struct socket *so,
INP_WLOCK_ASSERT(tptoinpcb(tp));
rack = (struct tcp_rack *)tp->t_fb_ptr;
- tcp_adapt_iss_check(tp);
if (!V_tcp_insecure_ack) {
tcp_seq seq_min;
bool ghost_ack_check;
@@ -11919,6 +11918,7 @@ rack_process_ack(struct mbuf *m, struct tcphdr *th, struct socket *so,
ourfinisacked = 1;
}
tp->snd_una = th->th_ack;
+ tcp_adapt_iss_check(tp);
/* wakeups? */
if (acked_amount && sbavail(&so->so_snd))
rack_adjust_sendmap_head(rack, &so->so_snd);
@@ -12678,6 +12678,7 @@ rack_fastack(struct mbuf *m, struct tcphdr *th, struct socket *so,
SOCK_SENDBUF_LOCK(so);
mfree = sbcut_locked(&so->so_snd, acked);
tp->snd_una = th->th_ack;
+ tcp_adapt_iss_check(tp);
/* Note we want to hold the sb lock through the sendmap adjust */
rack_adjust_sendmap_head(rack, &so->so_snd);
/* Wake up the socket if we have room to write more */
@@ -15963,6 +15964,7 @@ rack_do_compressed_ack_processing(struct tcpcb *tp, struct socket *so, struct mb
* should be).
*/
tp->snd_una = high_seq;
+ tcp_adapt_iss_check(tp);
}
/* Did we make a RTO error? */
if ((tp->t_flags & TF_PREVVALID) &&
@@ -15997,6 +15999,7 @@ rack_do_compressed_ack_processing(struct tcpcb *tp, struct socket *so, struct mb
SOCK_SENDBUF_LOCK(so);
mfree = sbcut_locked(&so->so_snd, acked_amount);
tp->snd_una = high_seq;
+ tcp_adapt_iss_check(tp);
/* Note we want to hold the sb lock through the sendmap adjust */
rack_adjust_sendmap_head(rack, &so->so_snd);
/* Wake up the socket if we have room to write more */