The branch main has been updated by rrs: URL: https://cgit.FreeBSD.org/src/commit/?id=9063968e8e394b8062a855592e12607b143c1b0f
commit 9063968e8e394b8062a855592e12607b143c1b0f Author: Randall Stewart <[email protected]> AuthorDate: 2026-02-24 16:47:36 +0000 Commit: Randall Stewart <[email protected]> CommitDate: 2026-02-24 16:47:36 +0000 Mitigate a case where TCP rack can send an extra ack. Rack will in theory send an extra rate limited ack when we get to a closing state (sending a FIN) so that if we have only 1 packet outstanding we might encourage the connection to close out. However it does this always which is not always wise. Change it so that it only does that if its been more than an srtt since we have had some activity i.e. a send or a receive of a packet. Reviewed by:tuexen, rscheff Differential Revision:<https://reviews.freebsd.org/D55459> --- sys/netinet/tcp_stacks/rack.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index f55abbf919b7..42c6757b4b2a 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -20742,8 +20742,17 @@ just_return_nolock: * The idea behind that is instead of having to have * the peer wait for the delayed-ack timer to run off * we send an ack that makes the peer send us an ack. + * + * Note we do not send anything if its been less than + * a srtt. */ - rack_send_ack_challange(rack); + uint64_t tmark; + + tmark = tcp_get_u64_usecs(&tv); + if ((tmark > rack->r_ctl.lt_timemark) && + (((tmark - rack->r_ctl.lt_timemark) / 1000) > tp->t_srtt)) { + rack_send_ack_challange(rack); + } } if (tot_len_this_send > 0) { rack->r_ctl.fsb.recwin = recwin; @@ -21143,7 +21152,7 @@ send: to.to_tsecr = tp->ts_recent; to.to_flags |= TOF_TS; if ((len == 0) && - (TCPS_HAVEESTABLISHED(tp->t_state)) && + (tp->t_state == TCPS_ESTABLISHED) && ((ms_cts - rack->r_ctl.last_rcv_tstmp_for_rtt) > RCV_PATH_RTT_MS) && (tp->snd_una == tp->snd_max) && (flags & TH_ACK) &&
