git: bb9525f30214 - main - TCP RACK: fix TCP fast open

From: Michael Tuexen <tuexen_at_FreeBSD.org>
Date: Mon, 06 Jan 2025 19:39:46 UTC
The branch main has been updated by tuexen:

URL: https://cgit.FreeBSD.org/src/commit/?id=bb9525f30214e8b6c53c6cccd9e8f02e8f8e8c42

commit bb9525f30214e8b6c53c6cccd9e8f02e8f8e8c42
Author:     Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2025-01-06 19:35:11 +0000
Commit:     Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2025-01-06 19:39:40 +0000

    TCP RACK: fix TCP fast open
    
    Do not jump to a place in the code, which requires several variables
    to be set (segsize, minseg, idle, len, sb_offset), which is not true.
    To avoid using these variables, start the HPTS timer explicitly.
    This fix only applies to the client side using TCP fast open.
    
    Approved by:            rrs
    CID:                    1523766
    CID:                    1523770
    CID:                    1523786
    CID:                    1523801
    CID:                    1523809
    MFC after:              1 week
    Sponsored by:           Netflix, Inc.
    Differential Revision:  https://reviews.freebsd.org/D48322
---
 sys/netinet/tcp_stacks/rack.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c
index cc0725324760..7baf1a626787 100644
--- a/sys/netinet/tcp_stacks/rack.c
+++ b/sys/netinet/tcp_stacks/rack.c
@@ -19943,10 +19943,11 @@ rack_output(struct tcpcb *tp)
 	     (tp->t_state == TCPS_SYN_SENT)) &&
 	    SEQ_GT(tp->snd_max, tp->snd_una) && /* initial SYN or SYN|ACK sent */
 	    (tp->t_rxtshift == 0)) {              /* not a retransmit */
-		cwnd_to_use = rack->r_ctl.cwnd_to_use = tp->snd_cwnd;
-		so = inp->inp_socket;
-		sb = &so->so_snd;
-		goto just_return_nolock;
+		rack_start_hpts_timer(rack, tp, cts, 0, 0, 0);
+#ifdef TCP_ACCOUNTING
+		sched_unpin();
+#endif
+		return (0);
 	}
 	/*
 	 * Determine length of data that should be transmitted, and flags