From nobody Mon Oct 03 11:38:06 2022 X-Original-To: dev-commits-src-all@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 4MgzNb1Nknz4dmC7; Mon, 3 Oct 2022 11:38:07 +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 4MgzNb0xyfz3nZf; Mon, 3 Oct 2022 11:38:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664797087; 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=bVwKJ9zgZxFkrPUayfoyuMB5bK6Wo59b0+foD4RiEUU=; b=enN5WGlBIv9uXODrYGLMReG/in77dcjeY7Kkxqz3IBo0KhxvuPu7mSF708VjScMfZYf3a/ dT+IsvtXdXbKlpcj4+ADMvnxZMrZwth/+Je+Hw8ulXDBPJEgCAztkheFPVSsoimIjiFlZw sZHCaF4hKpqIrSXyhunUdVcNnQ/vy/eksB7/wra42d2eUCKkMkVCr26uHHGxrmo8xjcLnT bOFQOvArYuhHY3eIH7Rb/OEroIP2EWHknxcstVFY3l/yOhDyui014KczQdqbiB0BQAhI9h LVNym7cg5kPz0qlK8j8ooWhNm3hOL6DwXAUNTw0ZX6ze8XWBGXMsEbI2fGOu0w== 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 4MgzNZ6qxrz1BHY; Mon, 3 Oct 2022 11:38:06 +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 293Bc60u086225; Mon, 3 Oct 2022 11:38:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 293Bc6kL086224; Mon, 3 Oct 2022 11:38:06 GMT (envelope-from git) Date: Mon, 3 Oct 2022 11:38:06 GMT Message-Id: <202210031138.293Bc6kL086224@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: f8b5681094dd - main - tcp: honor drop_synfin sysctl variable in TIME-WAIT List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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: f8b5681094dd752604bfa0603ba0be2873698f46 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664797087; 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=bVwKJ9zgZxFkrPUayfoyuMB5bK6Wo59b0+foD4RiEUU=; b=JI96WCxliaXGnrlRWK9OZucv/i3pPz8bjdX4U/G9y7NCuSbx7gWX68wfyBhi0BGSl0mvlF Uydf3Ek/5TQuPejEaH7ijDt3LzvK6lgp9y0Pq3E/8C4RuhCPHiG0FEAFn2vhmCAmGj6s8o YDRqsu/cT2oabOJjEbjOYNfo/1IVxbxIXZo1TQC5VpoEX/ZRPfIPP/z+p021uL4x7nEImJ vbov6s9RhHhfl85uIqPHCgFkifYs/n1NLvTb5Bkcm04tWiEDVq4iR96igiOWu/0AI5+aqL bxysWfII8rKa/ckgf/NGJ9MeuXN1s9GJBByVz1esDZHaJjjzW5Kp5PPo/DPw0A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1664797087; a=rsa-sha256; cv=none; b=NBSmOjdkgWafq4V1RpJkfzza//WWfZu/Oe9YNSZKtNFFpMx6E2anKklAThbkYfRqfynjQd O1bTLKXtX5jRJ0jyy+JjZZUNwxRUGAMPg3WWvAzGNxF/ilK3Bz3W/T88GSN0f62z8YShrS VeCx1grpi5o9y6Y/NFly1sk+HBSphXMFng1FueTw9QmKsCKYbcjxyloEWpzEzi5d5tCVSo cwqnZ6AwzR6C6TK+gciF83MkL0Kg9LUfjz8/iBnlVV2jX+VFXne9/KrT1Dji2IPFDHu2PX 3OGaK/zL8E2SbUSEsdJq9TsUnzaZngMPyB8W/J6uKGTqkPxWTPNz/pSbAulabw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=f8b5681094dd752604bfa0603ba0be2873698f46 commit f8b5681094dd752604bfa0603ba0be2873698f46 Author: Michael Tuexen AuthorDate: 2022-10-03 10:48:30 +0000 Commit: Michael Tuexen CommitDate: 2022-10-03 10:48:30 +0000 tcp: honor drop_synfin sysctl variable in TIME-WAIT Reviewed by: rrs@ MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D36862 --- sys/netinet/tcp_timewait.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c index 2ea57e0b3397..ad97e2d3bed6 100644 --- a/sys/netinet/tcp_timewait.c +++ b/sys/netinet/tcp_timewait.c @@ -50,9 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifndef INVARIANTS #include -#endif #include #include @@ -389,6 +387,7 @@ tcp_twcheck(struct inpcb *inp, struct tcpopt *to, struct tcphdr *th, struct mbuf *m, int tlen) { struct tcptw *tw; + char *s; int thflags; tcp_seq seq; @@ -447,6 +446,17 @@ tcp_twcheck(struct inpcb *inp, struct tcpopt *to, struct tcphdr *th, */ #endif + /* Honor the drop_synfin sysctl variable. */ + if ((thflags & TH_SYN) && (thflags & TH_FIN) && V_drop_synfin) { + if ((s = tcp_log_addrs(&inp->inp_inc, th, NULL, NULL))) { + log(LOG_DEBUG, "%s; %s: " + "SYN|FIN segment ignored (based on " + "sysctl setting)\n", s, __func__); + free(s, M_TCPLOG); + } + goto drop; + } + /* * If a new connection request is received * while in TIME_WAIT, drop the old connection