From nobody Fri Jun 27 20:52:45 2025 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 4bTSRy1dTDz60FdZ; Fri, 27 Jun 2025 20:52:46 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bTSRy03tpz3sn7; Fri, 27 Jun 2025 20:52:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751057566; 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=IE0vj9dQMcP8EYbIAhZ04ZO42SfUftoWM2WxCC01hXo=; b=xf8Enfb4zHRY3TLivhpjWDNiwyflwqeq6H69MWjMqYJELOVlaEc1g6aEPUHoWBfOR5DLk7 T/3Vz9vGk58joimP+TGSrEa0kNwYd24yKmI+kf+MIVNE8i8+YFwe6D3vWcGiVQQXwaxbF0 2eN0J1WlU1wIroSiuLkKfjiS4b03ftjpsLpXwWqTGGz0tqL+KspELD5Ic/mM/fd95VMVoZ Ha9NN+dOE1Qm/VFDO0iT5S2VU/AshpK8Y4r/F/ZCljA54Bc5/3L9ypdwEJPRRn8j+tc0D1 KymGwRabpR+lcv57qdEJGB0yHT2zwNKoiqEndot7AeRKFsb/imaLV7vU8omSHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751057566; 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=IE0vj9dQMcP8EYbIAhZ04ZO42SfUftoWM2WxCC01hXo=; b=ie+I39lyBFKGwspAjydQvtnQve23d3bRH5C1Iac6jcohb3ZFjsJkScnhZ9F/3Ef8RQ0s2y BrFHhMxyopZ07XLpzrPgKDEPgDyGHobgKokUm61GjC3F99XS1rsH5s6t61yDnV5zV5kmqi oXwI+t1GuvTly53AYuoKkaFmVYGjVe3yvEtb7QjSiFwqt54ziD7GTeDA/DvG5TDRajhI2A LOLe51XnFz4QHyBYAJ3H2QZaDacc18z+YDvi/k9c0CmiIC8Vvm4oByg8Hfyf/dNG5bF4Ey vbBmA54pMm9q+WvExu3Nu+Xyaw3L/OJSw7J3fnt03VB46ly0QpLm+n9bVnDxWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751057566; a=rsa-sha256; cv=none; b=Zg6FDqaE91kCGeT+URnnRO18zkAQp8xzgNlObMut/PfQQSEKuIG1N1BmaWDF3FfzuHVhF0 pT7XLBgKqUZirn4KGdnc7CaZZIOsMVlhw4Vj44DkbC1cg5eTCWfn+EpOPKihJbgOkmQQ7d sw/y96G7JJTLNVKA52g7gpdVP6auiZfvVJnRuFCKBZGM/Hvuu/PMUnPbdbOOi07IMA7Lzd vT7ZxFsqqbK37HGYKIfDhMXvHa37c3+kwBWMwGYc/zFhXIZNpeejcFufm1tclNFUVRXX3s rL/0eQXlbXnDgivvQ5pVdTch0yztPDaS8d8ve//hd9rZjIBmPxp4r9ivOViwtQ== 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 4bTSRx6kR4z138Y; Fri, 27 Jun 2025 20:52:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55RKqjNm085927; Fri, 27 Jun 2025 20:52:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55RKqjwk085924; Fri, 27 Jun 2025 20:52:45 GMT (envelope-from git) Date: Fri, 27 Jun 2025 20:52:45 GMT Message-Id: <202506272052.55RKqjwk085924@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: c3fc0db3bc50 - main - tcp: set net.inet.tcp.nolocaltimewait to 0 and deprecate it 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: c3fc0db3bc50df18a724e6e6b12ea4e060fd9255 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=c3fc0db3bc50df18a724e6e6b12ea4e060fd9255 commit c3fc0db3bc50df18a724e6e6b12ea4e060fd9255 Author: Michael Tuexen AuthorDate: 2025-06-27 20:47:21 +0000 Commit: Michael Tuexen CommitDate: 2025-06-27 20:47:21 +0000 tcp: set net.inet.tcp.nolocaltimewait to 0 and deprecate it Set the default value of the sysctl-variable net.inet.tcp.nolocaltimewait to 0. This will make the behavior compliant with RFC 9293. Furthermore document that using the sysctl-variable is deprecated and will be removed in FreeBSD 16. Reviewed by: glebius, Peter Lei Relnotes: yes Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D5106 --- share/man/man4/tcp.4 | 14 ++++++++++---- sys/netinet/tcp_timewait.c | 24 +++++++++++++++++++++--- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/share/man/man4/tcp.4 b/share/man/man4/tcp.4 index f19b6cb2ae14..fcfda42908d8 100644 --- a/share/man/man4/tcp.4 +++ b/share/man/man4/tcp.4 @@ -31,7 +31,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 26, 2025 +.Dd June 27, 2025 .Dt TCP 4 .Os .Sh NAME @@ -785,8 +785,8 @@ The Maximum Segment Lifetime, in milliseconds, for a packet when both endpoints are local. .Va msl_local is only used if -.Va nolocaltimewait -is zero. +.Va nolocaltimewait , +which is deprecated, is zero. .It Va mssdflt The default value used for the TCP Maximum Segment Size .Pq Dq MSS @@ -798,10 +798,16 @@ application limited and the network bandwidth is not utilized completely. That prevents self-inflicted packet losses once the application starts to transmit data at a higher speed. .It Va nolocaltimewait -Suppress creation of TCP +Suppress the creation of TCP .Dv TIME_WAIT states for connections in which both endpoints are local. +The default is 0. +.Va nolocaltimewait +is deprecated and will be removed in +.Fx 16 . +.Va msl_local +can be used instead. .It Va path_mtu_discovery Enable Path MTU Discovery. .It Va pcbcount diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c index 08673ddd1152..7c6c55909215 100644 --- a/sys/netinet/tcp_timewait.c +++ b/sys/netinet/tcp_timewait.c @@ -87,10 +87,28 @@ #include -VNET_DEFINE_STATIC(bool, nolocaltimewait) = true; +VNET_DEFINE_STATIC(bool, nolocaltimewait) = false; #define V_nolocaltimewait VNET(nolocaltimewait) -SYSCTL_BOOL(_net_inet_tcp, OID_AUTO, nolocaltimewait, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nolocaltimewait), 0, + +static int +sysctl_net_inet_tcp_nolocaltimewait(SYSCTL_HANDLER_ARGS) +{ + int error; + bool new; + + new = V_nolocaltimewait; + error = sysctl_handle_bool(oidp, &new, 0, req); + if (error == 0 && req->newptr) { + V_nolocaltimewait = new; + gone_in(16, "net.inet.tcp.nolocaltimewait is obsolete." + " Use net.inet.tcp.local_msl instead.\n"); + } + return (error); +} + +SYSCTL_PROC(_net_inet_tcp, OID_AUTO, nolocaltimewait, + CTLFLAG_VNET | CTLFLAG_RW | CTLTYPE_U8, + &VNET_NAME(nolocaltimewait), 0, sysctl_net_inet_tcp_nolocaltimewait, "CU", "Do not create TCP TIME_WAIT state for local connections"); static u_int