From nobody Fri Apr 17 07:14:11 2026 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 4fxmMr6DB4z6ZCjW for ; Fri, 17 Apr 2026 07:14:16 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxmMr3vDtz3Rmc for ; Fri, 17 Apr 2026 07:14:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776410056; 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=WYnMI2wN+qvevvs6YOlng/KzPh47uVJ6AyOKVAGiLAs=; b=c9FTUpnAmLheJTzBb8o+XJ0cv6hmi0uYqrE2bGYMYvNfCh4HPLmAUmeo3ZviJqMdg3nYuq +yN3Umieq1A03jx63107XI0pd0SGzWoWEU/hN/at7TMPSXlodIQtn85GN/h8hzFBt0Fb/A Z/9avnKCl8tC8GF+FY7d9qe6hdzC5ACI2jUAEw9WMvS8V4krRh/bU1w6uq5c0x/NuM8rJ1 tNj3IZwycYXG2XUtex5HKPWkW+OYo0deFeQ+NVFiZQlobYCJCnkFPBHOMjszFKGomSjtTg U/YaPIL+MjXI7cfvKGlTOnou84Q5itAe7NToUao39Ww1lS59hQyqk0ylin718Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776410056; a=rsa-sha256; cv=none; b=eOOuKYa5hG0LgUK8NGpd4iAZGDkvUP3+FH9pvqGhh6P1yRwZ9BNv1V9BjHvhgX/99b4dDR fCaqRmlS71Qsi1T4nOtcA2eLOk3tropq7tPQ9lC0EpK61aoO0hkgzAtRgDQuZXD9OeZAyA maeuvyAjvmrPEVNfw4y3GyAGD+GSSLzyjh21y4R73C5vXxrORekswsQdQ4Bkrja1zXnSii bMRdJHhXNoA/I3YbW8GMdIO4RpTlyZ/Bh9p8Sz1mMqQyH1OeIsNhTVi8XchY9khPShOWTY 08V6btijjlN48Gto37N6px4Sxm5G8kHi0F7rCqKoewBpKN/g7YV31c7W/uQ3kg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776410056; 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=WYnMI2wN+qvevvs6YOlng/KzPh47uVJ6AyOKVAGiLAs=; b=dAr3m3aG9O8YhBUgChhK9rSIpwMWDhDELueW/GL86uNxyjbxcLndmvnvkAoolVVOFOmB6a P7tDKDIRirmBvsiTLDLqauILdx1ebdTTPLNP2ftcIBTAUagrbJrYhHYYMINKV9cCpXMySX PUfxHSo7GetzWQoct8vY1+xJKNLs/3qnnYNAO89tZWMIexks/zd+OvkpO+gSrHXafGc6vd HRcJ73rbDZKncIemkMzLPIrhep7EFlX4CEvpzxYAKmRfs3e/oOoMV6GlXqxQD8Kl2kCiSe uOQgNTLLoi0hozomg565efHSZc1+0WUtxFSHPbeP4slaJYu2PEnsI7rtd8ZlDA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxmMr3Lcwzjvc for ; Fri, 17 Apr 2026 07:14:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 44589 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 07:14:11 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 3a54aa3b0911 - main - tcp: use RFC 6191 for connection recycling 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 3a54aa3b0911bef15e014b8a8185e116efb0a918 Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 07:14:11 +0000 Message-Id: <69e1ddc3.44589.2f60ace5@gitrepo.freebsd.org> The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=3a54aa3b0911bef15e014b8a8185e116efb0a918 commit 3a54aa3b0911bef15e014b8a8185e116efb0a918 Author: Michael Tuexen AuthorDate: 2026-04-17 07:11:41 +0000 Commit: Michael Tuexen CommitDate: 2026-04-17 07:11:41 +0000 tcp: use RFC 6191 for connection recycling in TIME-WAIT Implement the criteria specified in RFC 6191 for recycling TCP connections in TIME-WAIT. Reviewed by: rscheff, Marius Halden Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D56321 --- sys/netinet/tcp_timewait.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c index 430e98910743..eaa2fa336a94 100644 --- a/sys/netinet/tcp_timewait.c +++ b/sys/netinet/tcp_timewait.c @@ -215,12 +215,17 @@ tcp_twcheck(struct inpcb *inp, struct tcpopt *to, struct tcphdr *th, /* * If a new connection request is received * while in TIME_WAIT, drop the old connection - * and start over if the sequence numbers - * are above the previous ones. + * and start over if allowed by RFC 6191. * Allow UDP port number changes in this case. */ if (((thflags & (TH_SYN | TH_ACK)) == TH_SYN) && - SEQ_GT(th->th_seq, tp->rcv_nxt)) { + ((((tp->t_flags & TF_RCVD_TSTMP) != 0) && + ((to->to_flags & TOF_TS) != 0) && + TSTMP_LT(tp->ts_recent, to->to_tsval)) || + (((tp->t_flags & TF_RCVD_TSTMP) == 0) && + ((to->to_flags & TOF_TS) != 0) && + (V_tcp_tolerate_missing_ts == 0)) || + SEQ_GT(th->th_seq, tp->rcv_nxt))) { /* * In case we can't upgrade our lock just pretend we have * lost this packet.