From nobody Wed Jul 26 23:26:19 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RB9572XKVz4q11v; Wed, 26 Jul 2023 23:26:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RB95725spz45Kg; Wed, 26 Jul 2023 23:26:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690413979; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z6Y2penUdc7KsogB728a2Ih7PVLZb/drUbQCmlQgles=; b=ypdw4k6uzoCPO8JLbNwkXCLlqxs71yfuhO+PAKw8UTvx5sJbCvvG0+iVxiwRmpxsSQ8Oik 8eYPOgHMWRNEN9BaAu9S+KIJ0OiipDuxwq/IUGrVUN7gZOPUF5EpHMdKRqYDjL9mB0bRMN 4W7ASyet+slenbVYKUSHf07Hg2e7uvBbsGJjTvd1Tjcpfv3zAhvdWYxTKL/TUwm2uB1P6C BRKdJCfoPe236rdJkhqE+cBTffOl8Ua/ZeXi9xwYlTlpG968EnkqcmQLnszf7IQr96P033 ElDoibayHpzXiRou68Gj98WEtHAOMrJmdxxKrWlsYtqq7jYhMEJfFGoIJY10TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690413979; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z6Y2penUdc7KsogB728a2Ih7PVLZb/drUbQCmlQgles=; b=qGRfS4Ti65o/OHCDKa41rTAUyvePtkGKZrdMJEbP4STAEOFtv21Q9189hUBTOrIevKKFnM IfYLzfl6wTM08Oq06k0flKSHHimmytZZ45dXOexPQ42IwfMh7g3EUD3MfsD7blbwti0QWo huEZwG8daIl1RtV1HD2C8FZ6xqDOhWbAyeiMS4hqvOhizs/ggK2vRL7gPWWoRkkodvZh/l 3H6uXkhux0aaFSFj1W4MK2DvSaac97joukJkdx81kTzsE+l5lbsZlS6buPgRL6USo9skHe oZ0pf0p9QNfPxe9O0KfacdtIJRAYUMe0f4ywjemxggsnMscxuBIlH3ogWsKt/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690413979; a=rsa-sha256; cv=none; b=FsYi4RuFg1KJV3THSM8yqIrjOsiLxCTwJCl5YHBoJQRcmICrnts1P5PgnZEwAHd78VTaZX 3DhpF1f3HMAFNLLqtiDQKYO+WoJ1On4UFmjT5wrBzoRfjWODAYFhaKzmVwHTZJRGh3lft5 mSuW7455ceGWIqJgC8aG6mxW0NhXLcXzDYVby6mXr7EPgsZecaJIJOe7rTrrt3qKBMaDWe KAgjFrlZJ8Jq3k9qkwCLPIl8+nHbbrZHU4EQUHZJbR+MisxedwAWk3FHwZfiJzMvOr0OIm dtFWIneq8hHF2Hztd0P06wLprsK8nhixUGVfO+9glQ5blRrZz6ieF/C8+6qsdQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RB95715QJz11sG; Wed, 26 Jul 2023 23:26:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36QNQJhi015114; Wed, 26 Jul 2023 23:26:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36QNQJ00015113; Wed, 26 Jul 2023 23:26:19 GMT (envelope-from git) Date: Wed, 26 Jul 2023 23:26:19 GMT Message-Id: <202307262326.36QNQJ00015113@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: ab65c64bc402 - main - tcp: fix handling of segments in SYN-RCVD for RACK and BBR List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ab65c64bc40270b032f575c5733ea276b006d2ba Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=ab65c64bc40270b032f575c5733ea276b006d2ba commit ab65c64bc40270b032f575c5733ea276b006d2ba Author: Michael Tuexen AuthorDate: 2023-07-26 14:22:13 +0000 Commit: Michael Tuexen CommitDate: 2023-07-26 14:22:13 +0000 tcp: fix handling of segments in SYN-RCVD for RACK and BBR This deals with TCP endpoints in the SYN-RCVD state coming from the SYN-SENT state. Reviewed by: rscheff MFC after: 3 days Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D41203 --- sys/netinet/tcp_stacks/bbr.c | 6 +++--- sys/netinet/tcp_stacks/rack.c | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c index 1bc20de9e503..229f895b0285 100644 --- a/sys/netinet/tcp_stacks/bbr.c +++ b/sys/netinet/tcp_stacks/bbr.c @@ -8928,6 +8928,9 @@ bbr_do_syn_recv(struct mbuf *m, struct tcphdr *th, struct socket *so, bbr = (struct tcp_bbr *)tp->t_fb_ptr; ctf_calc_rwin(so, tp); + if ((thflags & TH_RST) || + (tp->t_fin_is_rst && (thflags & TH_FIN))) + return (ctf_process_rst(m, th, so, tp)); if ((thflags & TH_ACK) && (SEQ_LEQ(th->th_ack, tp->snd_una) || SEQ_GT(th->th_ack, tp->snd_max))) { @@ -8959,9 +8962,6 @@ bbr_do_syn_recv(struct mbuf *m, struct tcphdr *th, struct socket *so, return (0); } } - if ((thflags & TH_RST) || - (tp->t_fin_is_rst && (thflags & TH_FIN))) - return (ctf_process_rst(m, th, so, tp)); /* * RFC 1323 PAWS: If we have a timestamp reply on this segment and * it's less than ts_recent, drop it. diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 59dd113c03d5..5bfca4e3a687 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -13405,7 +13405,13 @@ rack_do_syn_recv(struct mbuf *m, struct tcphdr *th, struct socket *so, int32_t ret_val = 0; int32_t ourfinisacked = 0; + rack = (struct tcp_rack *)tp->t_fb_ptr; ctf_calc_rwin(so, tp); + if ((thflags & TH_RST) || + (tp->t_fin_is_rst && (thflags & TH_FIN))) + return (__ctf_process_rst(m, th, so, tp, + &rack->r_ctl.challenge_ack_ts, + &rack->r_ctl.challenge_ack_cnt)); if ((thflags & TH_ACK) && (SEQ_LEQ(th->th_ack, tp->snd_una) || SEQ_GT(th->th_ack, tp->snd_max))) { @@ -13413,7 +13419,6 @@ rack_do_syn_recv(struct mbuf *m, struct tcphdr *th, struct socket *so, ctf_do_dropwithreset(m, tp, th, BANDLIM_RST_OPENPORT, tlen); return (1); } - rack = (struct tcp_rack *)tp->t_fb_ptr; if (IS_FASTOPEN(tp->t_flags)) { /* * When a TFO connection is in SYN_RECEIVED, the @@ -13440,11 +13445,6 @@ rack_do_syn_recv(struct mbuf *m, struct tcphdr *th, struct socket *so, } } - if ((thflags & TH_RST) || - (tp->t_fin_is_rst && (thflags & TH_FIN))) - return (__ctf_process_rst(m, th, so, tp, - &rack->r_ctl.challenge_ack_ts, - &rack->r_ctl.challenge_ack_cnt)); /* * RFC 1323 PAWS: If we have a timestamp reply on this segment and * it's less than ts_recent, drop it.