From a43b0aca125e384dfd0bd9467baa033f01f00b40 Mon Sep 17 00:00:00 2001 From: Randall Stewart Date: Wed, 23 Feb 2022 16:25:56 -0500 Subject: [PATCH] tcp: Push bit failure to set in fastpath Recently changes were made to the tcp stack to use a macro/function to set tcp flags. In the process the PUSH bit setting in the fastpath of rack was broken. This fixes that as well as cleans up a warning that is occurring when you don't have INVARIANT on (inp used in KASSERT). We can use the tcp test suite to find this bug the test plan shows the script that fails due to the missing push bit Reviewed by: rscheff, tuexen Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D34332 --- sys/netinet/tcp_stacks/rack.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 63a36c71653..7bab75a637f 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -6258,11 +6258,11 @@ static int rack_timeout_persist(struct tcpcb *tp, struct tcp_rack *rack, uint32_t cts) { struct tcptemp *t_template; - struct inpcb *inp; +#ifdef INVARIANTS + struct inpcb *inp = tp->t_inpcb; +#endif int32_t retval = 1; - inp = tp->t_inpcb; - if (tp->t_timers->tt_flags & TT_STOPPED) { return (1); } @@ -16217,7 +16217,7 @@ again: } if (rack->r_ctl.fsb.rfo_apply_push && (len == rack->r_ctl.fsb.left_to_send)) { - tcp_set_flags(th, flags | TH_PUSH); + flags |= TH_PUSH; add_flag |= RACK_HAD_PUSH; } if ((m->m_next == NULL) || (len <= 0)){