From nobody Sun Dec 26 16:49:31 2021 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 A88A31922E59; Sun, 26 Dec 2021 16:49:32 +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 4JMRbb40vgz4v49; Sun, 26 Dec 2021 16:49:31 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 1E8FE5E95; Sun, 26 Dec 2021 16:49:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1BQGnVJ9014204; Sun, 26 Dec 2021 16:49:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BQGnVN0014203; Sun, 26 Dec 2021 16:49:31 GMT (envelope-from git) Date: Sun, 26 Dec 2021 16:49:31 GMT Message-Id: <202112261649.1BQGnVN0014203@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 66aeb0b53b39 - main - rack: drop connection synchronously, when we can 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: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 66aeb0b53b395cb44eb54a862d0667b63d379373 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640537371; 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=GsVunYZJAH3pHtKjOnJD3xUsCzFTksbZijYq9aND5KU=; b=CmaQcbGL16/PvvP2V9nkTHOK5c5MlgyWHhqQpLa9W5M1JaRW3e+euy4uv60a2JDWXdvAlZ wlzF5PHME+OeU3bX96NCiudY2NOsOr8ERnt5Lszbg5+zU8zkabiaMY1bX5akx1LS9l1DpJ L9Pe8tpmpsF4KogliRpEt7Srsa6r5esfYtOkq8a9u2/9r/ciZromNufXdgMiUBvzN6qSMS Fvug57WNVuuRbQOggtRde5yIqThHLUPIsnXwNsOjd3D/0BKWDzhpDKEOMmKaH5OjXdGygv vUdF/nnYq8xt5kMeH/ddfBi9xijwcIX1vMRHwTHZME7iqRol2ziw4y/ET8U9Kw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640537371; a=rsa-sha256; cv=none; b=ZT/hsVyOK4XYwh+WWqTmtvhKLeR8NUa3Lj5aRL2myI2ZJAxkCk5d63EeKTsTW1qba2VhTo ATyhOuVOQHCXesTmXqCMl2ZUtoaukyuDl79uiFPLQzZFIhaWQevXcd3EU7n6lksS+3yY4H GMgLcarUNoQ23GusmzLQqC6+tMvuf7SWcnKDOIysXSaNwzq2PYEmJ3olthmUGRJSVejiW1 7q8AEjBZkqB68hJO85q75u/SSrDWpzIsz8O18hECEqy381+qMWyvtOE7YuuFTQERZBnQos NnbzYyN2AQMfHNl+oyVVT56shCX1usWnZ4EQ92NBhxgkg4uEv1z5CY2+6pVLwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=66aeb0b53b395cb44eb54a862d0667b63d379373 commit 66aeb0b53b395cb44eb54a862d0667b63d379373 Author: Gleb Smirnoff AuthorDate: 2021-12-26 16:48:10 +0000 Commit: Gleb Smirnoff CommitDate: 2021-12-26 16:48:10 +0000 rack: drop connection synchronously, when we can For all functions that are leaves of tcp_input() call ctf_do_dropwithreset_conn() instead of ctf_do_dropwithreset(), cause we always got tp and we want it to be dropped. Reviewed by: rrs, tuexen Differential revision: https://reviews.freebsd.org/D33368 --- sys/netinet/tcp_stacks/rack.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 765b023e9658..4aa98443f55e 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -11853,8 +11853,7 @@ rack_do_established(struct mbuf *m, struct tcphdr *th, struct socket *so, if (sbavail(&so->so_snd)) { if (ctf_progress_timeout_check(tp, true)) { rack_log_progress_event(rack, tp, tick, PROGRESS_DROP, __LINE__); - tcp_set_inp_to_drop(tp->t_inpcb, ETIMEDOUT); - ctf_do_dropwithreset(m, tp, th, BANDLIM_RST_OPENPORT, tlen); + ctf_do_dropwithreset_conn(m, tp, th, BANDLIM_RST_OPENPORT, tlen); return (1); } } @@ -11955,8 +11954,7 @@ rack_do_close_wait(struct mbuf *m, struct tcphdr *th, struct socket *so, if (ctf_progress_timeout_check(tp, true)) { rack_log_progress_event((struct tcp_rack *)tp->t_fb_ptr, tp, tick, PROGRESS_DROP, __LINE__); - tcp_set_inp_to_drop(tp->t_inpcb, ETIMEDOUT); - ctf_do_dropwithreset(m, tp, th, BANDLIM_RST_OPENPORT, tlen); + ctf_do_dropwithreset_conn(m, tp, th, BANDLIM_RST_OPENPORT, tlen); return (1); } } @@ -12112,8 +12110,7 @@ rack_do_fin_wait_1(struct mbuf *m, struct tcphdr *th, struct socket *so, if (ctf_progress_timeout_check(tp, true)) { rack_log_progress_event((struct tcp_rack *)tp->t_fb_ptr, tp, tick, PROGRESS_DROP, __LINE__); - tcp_set_inp_to_drop(tp->t_inpcb, ETIMEDOUT); - ctf_do_dropwithreset(m, tp, th, BANDLIM_RST_OPENPORT, tlen); + ctf_do_dropwithreset_conn(m, tp, th, BANDLIM_RST_OPENPORT, tlen); return (1); } } @@ -12227,8 +12224,7 @@ rack_do_closing(struct mbuf *m, struct tcphdr *th, struct socket *so, if (ctf_progress_timeout_check(tp, true)) { rack_log_progress_event((struct tcp_rack *)tp->t_fb_ptr, tp, tick, PROGRESS_DROP, __LINE__); - tcp_set_inp_to_drop(tp->t_inpcb, ETIMEDOUT); - ctf_do_dropwithreset(m, tp, th, BANDLIM_RST_OPENPORT, tlen); + ctf_do_dropwithreset_conn(m, tp, th, BANDLIM_RST_OPENPORT, tlen); return (1); } } @@ -12342,8 +12338,7 @@ rack_do_lastack(struct mbuf *m, struct tcphdr *th, struct socket *so, if (ctf_progress_timeout_check(tp, true)) { rack_log_progress_event((struct tcp_rack *)tp->t_fb_ptr, tp, tick, PROGRESS_DROP, __LINE__); - tcp_set_inp_to_drop(tp->t_inpcb, ETIMEDOUT); - ctf_do_dropwithreset(m, tp, th, BANDLIM_RST_OPENPORT, tlen); + ctf_do_dropwithreset_conn(m, tp, th, BANDLIM_RST_OPENPORT, tlen); return (1); } } @@ -12454,8 +12449,7 @@ rack_do_fin_wait_2(struct mbuf *m, struct tcphdr *th, struct socket *so, if (ctf_progress_timeout_check(tp, true)) { rack_log_progress_event((struct tcp_rack *)tp->t_fb_ptr, tp, tick, PROGRESS_DROP, __LINE__); - tcp_set_inp_to_drop(tp->t_inpcb, ETIMEDOUT); - ctf_do_dropwithreset(m, tp, th, BANDLIM_RST_OPENPORT, tlen); + ctf_do_dropwithreset_conn(m, tp, th, BANDLIM_RST_OPENPORT, tlen); return (1); } }