From nobody Thu Nov 21 00:39:12 2024 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 4XtzrJ59txz5dxls; Thu, 21 Nov 2024 00:39:12 +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 4XtzrJ404cz4HSr; Thu, 21 Nov 2024 00:39:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732149552; 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=R9wYONsljD/BoH0idHwZflfaiMxqTj5NTetVY/yDly4=; b=ZHh2eSCcn7fUOOFcyHVxNX7UwC3GXIJq6AEGHjOL8dQzxpmqEgF0ryHZl6QyGzKLErnGFv S3TeesWnZYxYU0EXo8/wVzY4dgl5ofJkiJeUPkaaYanaUzRbNX0J0F7FnajyvdFGUim2Yq JIbcQoCpelVoi8SQeLme/Kam8D3CzQUO4aJXUKzqIIYK6joDbwbSHIAPHGR42/tYaMjiLn VWhy7e81S1wiZVWfjNePESuQSLPrfOdeEOn6phwbKQD1qdzS+9D5Ubp8T50893TsKeIXHT KB+Xy/Ti1Hno4FnbrWQ16YhTZUs4gV8fkQQI9wm3C/z3aWWTKfBHG6BmGSxtDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732149552; 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=R9wYONsljD/BoH0idHwZflfaiMxqTj5NTetVY/yDly4=; b=b6p82brfVa2b+E2CVNO1Bizjebg8xsCHexykg2C7n3rD1Ecq95za78q7mAZT6f4qHmL5u/ Xpf5ruD9TiHiaZ6vooQgbOq7giSwxv0UYnVhr1ila9WBuiCqs/cZ4yGlNhv1QsQDx7Rmwh cUZAnfT6ElGRgRu6pYmvmkOUfItoin8yGoxkxzqiBrYBKTVzeNV5TqzeYiGv9XWEn12iqk IoylvT0JQ1Qe62HKcdIn/yQ3TgzDAWF+F7TSYHuxq2noRbhCBz/DDbY9Q68LBeJd5x1Jp1 adsloHQ1vz8V3CI17xANyewFGj3aw2N4KeCcU2XQ5lM6bvY+EJL1orj7+y9UqQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732149552; a=rsa-sha256; cv=none; b=l5n9ZHkiXxRSFFuAn9kA2i9N667QKlRJVwrRi7du08HpLPiJQyG8duc+7kHcW7DgCMR096 HVEWw7yoju6Fr8WEx0Qbs1EhvrcyktwkzwDAEOvWopaNGSgygxqkQfvp/B1wTFtHQ49Fhm aSZbfTDkjxPTYgPyCafDNF9j6yed1+nfgb68UjdatV3ajcWmv98oLM/NXma3Bb+VraNH8S 6TdmfsRXPIEa450Umw/6wmuQoAYvkH3IasdedStwB6tTdGUWRGeTDCQfS7+2ZSmQ0cWZ+L lhqVK2OtpcPzXBjT8UN7cUeZDFaS+4JKsSxOjqonivxj17Eus67CpFtt/3dfvg== 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 4XtzrJ3DfnzH70; Thu, 21 Nov 2024 00:39:12 +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 4AL0dCrv044496; Thu, 21 Nov 2024 00:39:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AL0dCfs044493; Thu, 21 Nov 2024 00:39:12 GMT (envelope-from git) Date: Thu, 21 Nov 2024 00:39:12 GMT Message-Id: <202411210039.4AL0dCfs044493@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 2944a888eabf - main - tcp: remove so != NULL check 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: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2944a888eabffd4db47dde0f30aa0f5061460f56 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=2944a888eabffd4db47dde0f30aa0f5061460f56 commit 2944a888eabffd4db47dde0f30aa0f5061460f56 Author: Gleb Smirnoff AuthorDate: 2024-11-21 00:32:29 +0000 Commit: Gleb Smirnoff CommitDate: 2024-11-21 00:37:18 +0000 tcp: remove so != NULL check In the modern FreeBSD network stack a socket outlives its tcpcb. --- sys/netinet/tcp_subr.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index c30b3aaf76c3..4baeb6f8f2d2 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -2469,10 +2469,8 @@ tcp_discardcb(struct tcpcb *tp) * XXXRRS: Updating must be after the stack fini() since * that may be converting some internal representation of * say srtt etc into the general one used by other stacks. - * Lets also at least protect against the so being NULL - * as RW stated below. */ - if ((tp->t_rttupdated >= 4) && (so != NULL)) { + if (tp->t_rttupdated >= 4) { struct hc_metrics_lite metrics; uint32_t ssthresh; @@ -2482,9 +2480,6 @@ tcp_discardcb(struct tcpcb *tp) * are satisfied. This gives us better new start value * for the congestion avoidance for new connections. * ssthresh is only set if packet loss occurred on a session. - * - * XXXRW: 'so' may be NULL here, and/or socket buffer may be - * being torn down. Ideally this code would not use 'so'. */ ssthresh = tp->snd_ssthresh; if (ssthresh != 0 && ssthresh < so->so_snd.sb_hiwat / 2) {