From nobody Fri Sep 5 19:01:02 2025 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 4cJQfk6TwBz66FgF; Fri, 05 Sep 2025 19:01:02 +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" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cJQfk5ptDz3MCy; Fri, 05 Sep 2025 19:01:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757098862; 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=Jsv2e1MBwYKCnmW2AHLZBQWzTP0CcgKI9RfgNdisJbs=; b=Vlui42BAP4PEAHo97eF9u7C4d8er46rJ8YVOmyX3tvVKSvBlUOlSGC18cTURjG706nNATf sU5oUIN9nmQQ/PdPlzAGfpvx9I73AgxEAsZC4sIeCMlilCBWJgsLSD/i1JPeCxdRE098BL J9LwbAqqDgTFgY51Fi40A5/BqCnsuTmksc0RNSratmLZSMR2Rc64Ci4XZ7fq73e7ef24V0 lZ9xWXLL1vubCnaRHgY/Osvp3taYXGUN8rJ/45zEzaGloltYUG9SZMhFHSZHpS3Lw5JItA NPWErrN8fuZxfqWW2+50IGMkwlgDDX2KmM/wZgKwiGp05ztNFSGGD5xMfsHAXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757098862; 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=Jsv2e1MBwYKCnmW2AHLZBQWzTP0CcgKI9RfgNdisJbs=; b=YiijtVcnIAkMewCo31HYnM3QW1HIVPRRPl/Ze+vw7bR1XjbXn1MB8AHCFqWt6SbIpOSyAO /0Uroj957tHSwWKycV4Dl1/44ooEodTUxGuT3K3IeGdR3/V8hVstXMA2hmzTb/JfZg16bj xC8HJalk4gMIUaotlzxIAB0NuGGN6JuXMSBaxhO26VZJQoC25DlxBzhCmFCl+Koof07vhk NwvnXHgR1mRUIFYR7IECOpLml2+z3Tsl/qA68VndHTcHGTfLAMqemhXrJvsaOsYNWEoyiu 5xzSftcPTP/B+JvBouPpFMtmCrt0gyJMV+CjSNV+mTdOGaLf59zJTV196HzlLA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1757098862; a=rsa-sha256; cv=none; b=NwsJ2Aym3Lj2kljAlaUBRmP7kuWgqxT91VAY64UWaqm68z7lZrEx9Ut85ng3GzcrEBxH/p +aN3w1BdZJypUParVMqA3AU2q3Li4Iavfy8692OvPqidpNG6Q+5/HNrs2NMQtg5jH0JT67 xI9HHefITifDctw4WKlzM6+8aB3DfyVOuIH6CUPcDvibCeZzEfUDz0vZMoHgbpEttA15wr UGAyLc5QXxpLKInUJUxMRwyccCSJ0aTJKVmwl7S6yRRu4BG+JpYx1xP7mUBJvlmBLuIIJ4 /UMVKTe8L5QiatlI6V8yMlAsGrmTkaiisJq/jDrBACQUuJWlSElhNW99RWyLjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4cJQfk52mBz11Df; Fri, 05 Sep 2025 19:01:02 +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 585J12qY031324; Fri, 5 Sep 2025 19:01:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 585J12p9031320; Fri, 5 Sep 2025 19:01:02 GMT (envelope-from git) Date: Fri, 5 Sep 2025 19:01:02 GMT Message-Id: <202509051901.585J12p9031320@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 95fbcd9cada8 - stable/14 - tcp: minor cleanup 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 95fbcd9cada82ca2e9be6a385f2225670c7d509f Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=95fbcd9cada82ca2e9be6a385f2225670c7d509f commit 95fbcd9cada82ca2e9be6a385f2225670c7d509f Author: Michael Tuexen AuthorDate: 2025-08-12 12:48:27 +0000 Commit: Michael Tuexen CommitDate: 2025-09-05 19:00:40 +0000 tcp: minor cleanup Don't use the rstreason variable as a hint that a second lookup is performed, since the rstreason variable will be removed. Use the INPLOOKUP_WILDCARD flag in the lookupflag variable instead. No functional change intended. Reviewed by: rrs Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D51847 (cherry picked from commit 6e07231667e639bd825e6cdb67609a39e3098e9d) --- sys/netinet/tcp_input.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 93d2e94bcff0..c72c315271fb 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -922,23 +922,23 @@ findpcb: * XXX MRT Send RST using which routing table? */ if (inp == NULL) { - if (rstreason != 0) { + if ((lookupflag & INPLOOKUP_WILDCARD) == 0) { /* We came here after second (safety) lookup. */ - MPASS((lookupflag & INPLOOKUP_WILDCARD) == 0); - goto dropwithreset; - } - /* - * Log communication attempts to ports that are not - * in use. - */ - if ((V_tcp_log_in_vain == 1 && (thflags & TH_SYN)) || - V_tcp_log_in_vain == 2) { - if ((s = tcp_log_vain(NULL, th, (void *)ip, ip6))) + MPASS(!closed_port); + } else { + /* + * Log communication attempts to ports that are not + * in use. + */ + if (((V_tcp_log_in_vain == 1 && (thflags & TH_SYN)) || + V_tcp_log_in_vain == 2) && + (s = tcp_log_vain(NULL, th, (void *)ip, ip6))) { log(LOG_INFO, "%s; %s: Connection attempt " "to closed port\n", s, __func__); + } + closed_port = true; } rstreason = BANDLIM_TCP_RST; - closed_port = true; goto dropwithreset; } INP_LOCK_ASSERT(inp); @@ -1119,7 +1119,8 @@ findpcb: * don't want to sent RST for the second ACK, * so we perform second lookup without wildcard * match, hoping to find the new socket. If - * the ACK is stray indeed, rstreason would + * the ACK is stray indeed, the missing + * INPLOOKUP_WILDCARD flag in lookupflag would * hint the above code that the lookup was a * second attempt. * @@ -1127,7 +1128,6 @@ findpcb: * of the failure cause. */ INP_WUNLOCK(inp); - rstreason = BANDLIM_TCP_RST; lookupflag &= ~INPLOOKUP_WILDCARD; goto findpcb; }