git: 96691152d13b - main - Mark Johnsons Claude code found a duplicate call to rack_check_reorder_ack() in rack.c
Date: Sun, 08 Nov 2026 12:29:08 UTC
The branch main has been updated by rrs:
URL: https://cgit.FreeBSD.org/src/commit/?id=96691152d13be08926aa48e2cbdae1dfa36dd76c
commit 96691152d13be08926aa48e2cbdae1dfa36dd76c
Author: Randall Stewart <rrs@FreeBSD.org>
AuthorDate: 2026-11-08 12:27:06 +0000
Commit: Randall Stewart <rrs@FreeBSD.org>
CommitDate: 2026-11-08 12:27:06 +0000
Mark Johnsons Claude code found a duplicate call to rack_check_reorder_ack() in rack.c
Mark's Claude code properly points out an interesting bug case where if a new block is
created from a sack aka
rsm |--------|
sackblk |--------->
Then when the new block is created rack_check_reorder_ack() is called and then called again when
the block is actually ack'ed. Proper thing is to *not* in this case call the function and only call
it at the processing to ACK. You leave the hookery side however since that is just transfering
the existing block pointers.
Differential Revision:https://reviews.freebsd.org/D61159
---
sys/netinet/tcp_stacks/rack.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c
index 19a5f055c0f2..b27c1e3e9809 100644
--- a/sys/netinet/tcp_stacks/rack.c
+++ b/sys/netinet/tcp_stacks/rack.c
@@ -9554,8 +9554,10 @@ do_rest_ofb:
}
rack_log_map_chg(tp, rack, NULL, rsm, nrsm, MAP_SACK_M2, end, __LINE__);
rsm->r_flags &= (~RACK_HAS_FIN);
- /* Check if the ack was too soon i.e. reordering + ack arrives too quickly */
- prohibit_marking = rack_check_reorder_ack(tp, rack, nrsm, nrsm->r_end, cts, 0, __LINE__);
+ /* Don't do a rack_check_reorder_ack() here since this block just gets
+ * us so the new rsm can be handled down below in the if(SEQ_GEQ(end, rsm->r_end) below.
+ * It will be called in that block.
+ */
/* Position us to point to the new nrsm that starts the sack blk */
rsm = nrsm;
}