From nobody Tue Aug 12 12:51:20 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 4c1WbD6KKwz64j19; Tue, 12 Aug 2025 12:51:20 +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 4c1WbD5bPnz3HHN; Tue, 12 Aug 2025 12:51:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1755003080; 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=2RFH1P5A0MHjpx3WtPEdC8dl5KNzgmm58z2o2QLD1CE=; b=OoQEYMGBqIU7V7xUgmaf/lOEHiXZuoW00GoARhojJA2FsPN47faPXsRBDdJgGcL5qha6Jn G9MgBT/9VwLynZFNYER51KtbNMMZxV5nrMkkF4j2PXAjcnUkFnwLcR+O4DzMz9DFRM/eTg 4SsoNbRBt15Zd0xEWENKzfx7vy8fUfCOFU4B/v7GpHGEisK99z7PlZgxmQXrXlpAvGvMNA 8uKbZNLRPmUNovxXRZwXuM6h832cI06nkhoxTGuFwqW+OCz27rRYtPxC0otfL7RZEWrCJi gYSkur40Vt0wVh+Y+wPmbCdGvVyInQwtxj+25jskFkYf4ll1/Hvc7A4edcCtgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1755003080; 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=2RFH1P5A0MHjpx3WtPEdC8dl5KNzgmm58z2o2QLD1CE=; b=CR3QLZfBYkgQlG/HKRsgKr6II/Jy93PoqUXOYhp1Qiasxsm1pXXi32a9sm338ke0bPTgRt I2fun0mxiPcrBMFNPhjIoYyQcPcbAvTuVYYnUoD05IYZzxqTf7upOrXFAWk6WOX8UO6euG LSA9qz6j7agTTALxzrNHClRxtUn5TllA8N9+EO20/xmfLRDu5EaZzTmlmt8A8fC1/sBN4h mDmrCLqW5lVGOPl1++31HDdsAQg+RBUZBnqK7yKfRdwCerlYZx1d0mg4igUgNuI6w9dbtC Ub51WuPiAv5rgPhBVWl978wP9HJNIG5zh8Z1WjyRA2rWOqt/5kIBa1jFdA1/yQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1755003080; a=rsa-sha256; cv=none; b=BS4jlK7DYBaiVCNIq1Aiy98o1VLMYvLtQty13PfeAIlxTE1vPt/MJM3yrViQ84bcQW87Dg UoRnB+AD/bGaHcoWeZsvKD+nuVkYnqVDaqvFXhrrZLDKEV9dX0gbXt5wwvl3w09CEkCuLd Dv6m1/JcszMqeuJjTqAWl4uRIDrOuJHEFVsBsLRZYVLdQPqdhA9ZvJv1Mf9INM9AuGkm8n rf12H4SdFmZudTgfU2Y+wKmUKjtMfXsPoE08OUpkr5pcaSHF6huhNou2FjHigPuGwpsXv+ 8xLd8pUvFSMlwGsVH4i01n5wGty4SdWb4yLgcWu1zofoxYG9VDdEFSz++XK6Dw== 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 4c1WbD59MSzfVS; Tue, 12 Aug 2025 12:51:20 +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 57CCpKG3081971; Tue, 12 Aug 2025 12:51:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 57CCpKbq081967; Tue, 12 Aug 2025 12:51:20 GMT (envelope-from git) Date: Tue, 12 Aug 2025 12:51:20 GMT Message-Id: <202508121251.57CCpKbq081967@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: 6e07231667e6 - main - tcp: minor cleanup 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: 6e07231667e639bd825e6cdb67609a39e3098e9d Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=6e07231667e639bd825e6cdb67609a39e3098e9d commit 6e07231667e639bd825e6cdb67609a39e3098e9d Author: Michael Tuexen AuthorDate: 2025-08-12 12:48:27 +0000 Commit: Michael Tuexen CommitDate: 2025-08-12 12:51:07 +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 MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D51847 --- 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 d392cbe09950..ddd0dbeafd06 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -905,23 +905,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); @@ -1102,7 +1102,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. * @@ -1110,7 +1111,6 @@ findpcb: * of the failure cause. */ INP_WUNLOCK(inp); - rstreason = BANDLIM_TCP_RST; lookupflag &= ~INPLOOKUP_WILDCARD; goto findpcb; }