From nobody Thu Aug 22 20:21:05 2024
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 4WqZN13bcGz5TZT5;
	Thu, 22 Aug 2024 20:21:05 +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 "R11" (verified OK))
	by mx1.freebsd.org (Postfix) with ESMTPS id 4WqZN139skz4V4g;
	Thu, 22 Aug 2024 20:21:05 +0000 (UTC)
	(envelope-from git@FreeBSD.org)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
	t=1724358065;
	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=BmD9dJWyk2IkE8wv0KgLPOUNQu625VuAE3q7sqB4Nig=;
	b=GN/vaWny3R/iy/jcIgTxjnFdBCLIHJRZCRmuE/jlG4owMUG84zqqxOYFfLSZRFP6JZvuE2
	kOBZRUmKkplV2q7LvFLbEDIuiM9Y/dlSApqdlM/OVytppsD0srjJXh3yQdzkKUxy7cJ53+
	z36xM8UnHmzOqFhFH+pI0wvPz8BMEgnRCEGUrt/Z9HYThOaXko9vrSvYPZYWAmtbi+/yQ4
	Bp1n+6LiND+EIUquNFqHNwZkEKJb+0rEL6oa1kH4UdMq0W5eds+mwljToKDpNu24tGybnV
	V7Nw8CFVg17Yj81TU0ZrvJdAs07d15E/vis+G+ZAUGu3bgFs7zBjfff1Q1TnUA==
ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724358065; a=rsa-sha256; cv=none;
	b=wCBjyrbKzbpNM1FwPVCa3E996hsgV2o6ILuMfves/FEQqdwS6R06R+qhsbPjDbmSvhBdTn
	cQXlLx34+2rlpX4ZJ5q9O1yM20/pvoVcgrzMHKS7lnPPSVoD6VWzL57TkdZUHbkiT4aIbP
	t2g9h04qoaSISI7mb9kT2yNg9AthQl5dRcdij6GxjEP4kMgl+M8dD1sJQ4zUNjL7tJrobw
	gLsXmM1jyHwEW5Ef+KeWidMGT0xxIiEOjGXaZKNnQZZ+7svNflug8ZhLuBB+T0+Zf8Lslm
	o7BMLHw82qeEQZQbFkS2R0uRv++jH5/rlu/dCOaxEedxe90IpJwEH2OwuyeZSQ==
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=1724358065;
	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=BmD9dJWyk2IkE8wv0KgLPOUNQu625VuAE3q7sqB4Nig=;
	b=Khpobcvq/7iJMlQBgjtxwBO2BeSj7ij85pl/3xGUMBxXq8S4ijQrIgAhO/Il8yBxpeVMgE
	DfSK2qmUdb8QfbayHNsmScIu9NuMhtCOg5Z6NLnFgtjI0GFLHVqk7ZphGmZ9hhxyRewwRH
	nTbAJmuRF+Nv9dwIwwzjF8OGOsZwe4ijUQgDceeQY/3ZuvVe598TPy2PqO0hCBidfs5kiz
	pDIBBceEtva4eBQjyNy/m4Z4U2cRQBlxI4y9riFjR5DQ+CTZW+0mDExDirA0RotEBqNrBR
	dj8oxUJGtcTceOt+WftELT/w6170SEIEvl5e1L53C37tzd1a5PDVPqydl/lsWA==
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 4WqZN12n3mzhTx;
	Thu, 22 Aug 2024 20:21:05 +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 47MKL5tt012896;
	Thu, 22 Aug 2024 20:21:05 GMT
	(envelope-from git@gitrepo.freebsd.org)
Received: (from git@localhost)
	by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47MKL5O2012893;
	Thu, 22 Aug 2024 20:21:05 GMT
	(envelope-from git)
Date: Thu, 22 Aug 2024 20:21:05 GMT
Message-Id: <202408222021.47MKL5O2012893@gitrepo.freebsd.org>
To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org,
        dev-commits-src-main@FreeBSD.org
From: Michael Tuexen <tuexen@FreeBSD.org>
Subject: git: e41364711ca3 - main - tcp: improve consistency of
  SYN-cache handling
List-Id: Commit messages for the main branch of the src repository <dev-commits-src-main.freebsd.org>
List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main
List-Help: <mailto:dev-commits-src-main+help@freebsd.org>
List-Post: <mailto:dev-commits-src-main@freebsd.org>
List-Subscribe: <mailto:dev-commits-src-main+subscribe@freebsd.org>
List-Unsubscribe: <mailto:dev-commits-src-main+unsubscribe@freebsd.org>
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: e41364711ca3f7e214f9607ebedf62e03e51633d
Auto-Submitted: auto-generated

The branch main has been updated by tuexen:

URL: https://cgit.FreeBSD.org/src/commit/?id=e41364711ca3f7e214f9607ebedf62e03e51633d

commit e41364711ca3f7e214f9607ebedf62e03e51633d
Author:     Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2024-08-22 20:17:05 +0000
Commit:     Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2024-08-22 20:17:05 +0000

    tcp: improve consistency of SYN-cache handling
    
    Originally, a SYN-cache entry was always allocated and later freed,
    when not needed anymore. Then the allocation was avoided, when no
    SYN-cache entry was needed, and a copy on the stack was used.
    But the logic regarding freeing was not updated.
    This patch doesn't re-check conditions (which may have changed) when
    deciding to insert or free the entry, but uses the result of
    the earlier check.
    This simplifies the code and improves also consistency.
    
    Reviewed by:            glebius
    MFC after:              1 week
    Sponsored by:           Netflix, Inc.
    Differential Revision:  https://reviews.freebsd.org/D46410
---
 sys/netinet/tcp_syncache.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c
index 025b071eb1ca..33a6a66b7138 100644
--- a/sys/netinet/tcp_syncache.c
+++ b/sys/netinet/tcp_syncache.c
@@ -1720,9 +1720,7 @@ skip_alloc:
 	 * Do a standard 3-way handshake.
 	 */
 	if (syncache_respond(sc, m, TH_SYN|TH_ACK) == 0) {
-		if (V_tcp_syncookies && V_tcp_syncookiesonly && sc != &scs)
-			syncache_free(sc);
-		else if (sc != &scs)
+		if (sc != &scs)
 			syncache_insert(sc, sch);   /* locks and unlocks sch */
 		TCPSTAT_INC(tcps_sndacks);
 		TCPSTAT_INC(tcps_sndtotal);