From nobody Fri Oct 23 17:17: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 4jB8pH1Q7xz6xK4q for ; Fri, 23 Oct 2026 17:17:11 +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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jB8pH0Y9dz51XF for ; Fri, 23 Oct 2026 17:17:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1792775831; 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=yCaUlJDIO69OK7djZs5RehKEhamZM+RBeMPQFj1yJtM=; b=ALMEtIr9AUWWYPfBdueCS3MLrLeVpWXBnDIAdtxof24D7wKJ++57d07XUwUQV0zfdRIxt7 YbSn0OeFid8GHer+v6PJDRg8soJdCVNf1/ZdWF0YHQMjil2QPbYvsCk29bVhCKl6oXbd6Z DK9rUckIUvFFVqka3zl3mnjkBoWMIh/wVLSpA1OBCZET3YvPIfW3eWYgX8vFgQp1ghaZfg BpkHeE1f1GKqedOieBTiWh3u3i74+HA3Q206HutxgT9XJuKAcO0MBzUg6Bu6hpI5uQZe90 1yvDZ9hZdbE5/ORcW+Pd98UlRdiHpFB/a8YsPIyRu2C3M3RkKJRH97e3NqxbqA== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1792775831; b=WTeXlTw8FQFW+g5G/V/GpEoTub5IA7osLj+bA5RDvd5PUM19IHxqZNQgbVR6zzmzl+A4Uv Q1YB6/RzzPDMgZKjfWiZ8ig9iznfAxvdXbPjgg9pg1TO8KHibYUFfPALPE6R23Gknwa85o jzgNiqW+f5oCfs1fiFXB5w5BH4N3o12vAJ6Q+6qY6rvm+7o/42NCcE69GLTV6MEvlFEo5B UccC1wrTCdtJlEE1WDLk7B9+++lHuSE5FPzag5kPu/UitnpEcGYHlSSPArAl0xqHzOE3RS loryGpCHA03684ArI+5LsMxuWToL/6IWefEdtCqQc4xPFD1IPf+xIs6Tv1SN1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1792775831; 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=yCaUlJDIO69OK7djZs5RehKEhamZM+RBeMPQFj1yJtM=; b=eTIP/mKNqLUcoQzhiHJoTxXTzAHgOB/waOEbyBJ36eY6ywyvlUWQw2HM7EmkuNKe73gfj6 Jfdpesle5Ap7np3kuqRrSuXGzkkO74AMbFn8QC2EQfM9VKu1xHIxH4WMeSTF6ShoVBfQQw aXDP58ozOf8BXm9xvleXNmIUqECd0XgQosAYBwJt3QwhXKKLkjEuw08wXMHJhE/0PLjQuf a6Z3u3eXtcNrBV37jY9dEnghFH3GjOWGt6uaB/jByhv0zGuwKIwIoiy3RbZSyDzYAjkQO1 TVg9SMtQpf39XtIyrXhwcJDWuK0TFczNLvEzvlEIUPSSZnYawfibieBLXVdbcQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jB8pH065XzfKY for ; Fri, 23 Oct 2026 17:17:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3d0fd by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 23 Oct 2026 17:17:11 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 6873fec25b54 - stable/15 - tcp: minor cleanup List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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/15 X-Git-Reftype: branch X-Git-Commit: 6873fec25b542c1780bf1723e253856631b4b896 Auto-Submitted: auto-generated Date: Fri, 23 Oct 2026 17:17:11 +0000 Message-Id: <6adb9697.3d0fd.15234bf3@gitrepo.freebsd.org> The branch stable/15 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=6873fec25b542c1780bf1723e253856631b4b896 commit 6873fec25b542c1780bf1723e253856631b4b896 Author: Michael Tuexen AuthorDate: 2026-08-24 19:00:14 +0000 Commit: Michael Tuexen CommitDate: 2026-10-23 17:15:56 +0000 tcp: minor cleanup Several cleanups in tcp_input_with_port(): * Don't assign m twice. * Don't reassign pointers without having done pullup(). * While there, change the type of isipv6 to bool, since it is used that way. No functional change intended. Reported by: Hannes Elfert Reviewed by: pouria, Timo Völker, Nick Banks Differential Revision: https://reviews.freebsd.org/D59142 (cherry picked from commit 191dad334c646457c012d0d0963505a2f2d73a98) --- sys/netinet/tcp_input.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 15035cc913ab..a1786952741e 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -593,7 +593,7 @@ tcp6_input(struct mbuf **mp, int *offp, int proto) int tcp_input_with_port(struct mbuf **mp, int *offp, int proto, uint16_t port) { - struct mbuf *m = *mp; + struct mbuf *m; struct tcphdr *th = NULL; struct ip *ip = NULL; struct inpcb *inp = NULL; @@ -614,7 +614,7 @@ tcp_input_with_port(struct mbuf **mp, int *offp, int proto, uint16_t port) struct m_tag *fwd_tag = NULL; #ifdef INET6 struct ip6_hdr *ip6 = NULL; - int isipv6; + bool isipv6; #else const void *ip6 = NULL; #endif /* INET6 */ @@ -624,10 +624,6 @@ tcp_input_with_port(struct mbuf **mp, int *offp, int proto, uint16_t port) NET_EPOCH_ASSERT(); -#ifdef INET6 - isipv6 = (mtod(m, struct ip *)->ip_v == 6) ? 1 : 0; -#endif - off0 = *offp; m = *mp; *mp = NULL; @@ -636,6 +632,7 @@ tcp_input_with_port(struct mbuf **mp, int *offp, int proto, uint16_t port) m->m_pkthdr.tcp_tun_port = port; #ifdef INET6 + isipv6 = mtod(m, struct ip *)->ip_v == 6; if (isipv6) { ip6 = mtod(m, struct ip6_hdr *); th = (struct tcphdr *)((caddr_t)ip6 + off0); @@ -774,9 +771,9 @@ tcp_input_with_port(struct mbuf **mp, int *offp, int proto, uint16_t port) TCPSTAT_INC(tcps_rcvshort); return (IPPROTO_DONE); } + ip6 = mtod(m, struct ip6_hdr *); + th = (struct tcphdr *)((caddr_t)ip6 + off0); } - ip6 = mtod(m, struct ip6_hdr *); - th = (struct tcphdr *)((caddr_t)ip6 + off0); } #endif #if defined(INET) && defined(INET6)