From nobody Mon Jul 07 10:06:52 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 4bbKf465g0z61J37; Mon, 07 Jul 2025 10:06:52 +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 4bbKf44StQz3dZq; Mon, 07 Jul 2025 10:06:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751882812; 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=F8+D38bQ4xI3bPzBPwAyn4tUzu2bHkjyMC3BQZsX7gM=; b=TlQiItOBw4jgVr7/ELPXnTERtMB8nnbmavK2R0P2+YpcD3YOtuhLf1TFqSQxxNugiDLV0Q jHdDL0inxbCgZL7t/Ecc15oPFBDCDmdP+a9WF/nxoDtYwP+B7nAVdULMsccXu1BWCzUfn0 YkbQd0mzwjjhzvit2vSKWMf4eA7KSocV8I73lKvXJWjgbgdpvZQBUGLUNj0a8O8iJTL67f G/j3UBuD266Hajcb/k3MQDZBOBoPNkZhX7L4VsOuaDGN6pEBewQh3aVSLQCbVkC4pJlRtR D6usL/0+3ZEoSCBH2Jr31ZHuG2fY1iZTxi4l7E8nWgzHQriI87UevPN4FKuLjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751882812; 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=F8+D38bQ4xI3bPzBPwAyn4tUzu2bHkjyMC3BQZsX7gM=; b=GD++Nn3Xu+J1Q1ldEFAVyRNK3Uc72iomwXDZ+wvnekJtsNVnHL5ZOy5sX+rlr1eiCWQnSN Y8g5M/UOKsQFY2v2lkj7lTH/HNIzek6x99zg9Wituq1a60k7i/ClkKIvqjlqsyxhb+urA9 Z9aaY4dxsZqIWx5pazJMeE6zWh7YAvOI/1Xre0IJGLZTeqSow12l+Ns/XnFRp+coMVGO4h FVhUt64+hOKIe3aPmIELhC8bo33CpdTa+U2yCdtof35IRqRD3fzmcaQXRm/aUwKiRfJjuS KbBUc6zQJbsO12XMf4TDJtLgV4/OP5+uYtv3WnjxRNyWWx7CyDqxbku3Q+oUkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751882812; a=rsa-sha256; cv=none; b=rTQZNb55FcmUHKP5rh5Q6khBcDuslilayn/leWg+MF9q0Fo/yrHs7fXW+peCzlRd7s4ZQz LXu8wagc7NGJhqhWwgC+3iIf/rcMnA4IBBX7wLMVevcOqk0SD06HWUQWkJiPw7CVyT0rEc K1Se1DLychb6ZY1TMfKQ57vBLNHEH4J1JoxmZVQHz33RAEWNPJVK1F7C6x0DO85+fPd/CP Hje2GGR1MnCW0Pv2K7KBKvcOOxc9OO33lMQyDdxRS3fmRqhRYRB1d7ZokAmAos/PfN3r4+ jeDGKeSURUdU/sX9qX5Po1SEEuZAzrN9Xg8IyqA3RTnOPrk54qj+H1tuKgti7A== 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 4bbKf43tSCzmcs; Mon, 07 Jul 2025 10:06:52 +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 567A6qpF053235; Mon, 7 Jul 2025 10:06:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567A6qfo053232; Mon, 7 Jul 2025 10:06:52 GMT (envelope-from git) Date: Mon, 7 Jul 2025 10:06:52 GMT Message-Id: <202507071006.567A6qfo053232@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: f5195b1a63df - stable/14 - netinet6: Remove a set but not used global variable in6_maxmtu 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: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f5195b1a63df2c84d05b29a908e96c107f86a029 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=f5195b1a63df2c84d05b29a908e96c107f86a029 commit f5195b1a63df2c84d05b29a908e96c107f86a029 Author: Zhenlei Huang AuthorDate: 2025-05-21 10:09:01 +0000 Commit: Zhenlei Huang CommitDate: 2025-07-07 10:00:29 +0000 netinet6: Remove a set but not used global variable in6_maxmtu and its setter in6_setmaxmtu(). This variable was introduced by the KAME projec [1]. It holds the max IPv6 MTU through all the interfaces, but is never used anywhere. [1] 82cd038d51e2 KAME netinet6 basic part(no IPsec,no V6 Multicast Forwarding, no UDP/TCP for IPv6 yet) Reviewed by: glebius MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D49357 (cherry picked from commit e64fe5ad3a23a9f471ebf11e04e490588913c7af) --- sys/netinet6/in6.c | 25 ------------------------- sys/netinet6/in6_ifattach.c | 6 ------ sys/netinet6/in6_var.h | 4 ---- sys/netinet6/nd6.c | 4 ---- sys/netinet6/nd6_rtr.c | 8 ++------ 5 files changed, 2 insertions(+), 45 deletions(-) diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index 60497ae29852..0e2c19efe9d5 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -2114,31 +2114,6 @@ in6if_do_dad(struct ifnet *ifp) return (1); } -/* - * Calculate max IPv6 MTU through all the interfaces and store it - * to in6_maxmtu. - */ -void -in6_setmaxmtu(void) -{ - struct epoch_tracker et; - unsigned long maxmtu = 0; - struct ifnet *ifp; - - NET_EPOCH_ENTER(et); - CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) { - /* this function can be called during ifnet initialization */ - if (!ifp->if_afdata[AF_INET6]) - continue; - if ((ifp->if_flags & IFF_LOOPBACK) == 0 && - IN6_LINKMTU(ifp) > maxmtu) - maxmtu = IN6_LINKMTU(ifp); - } - NET_EPOCH_EXIT(et); - if (maxmtu) /* update only when maxmtu is positive */ - V_in6_maxmtu = maxmtu; -} - /* * Provide the length of interface identifiers to be used for the link attached * to the given interface. The length should be defined in "IPv6 over diff --git a/sys/netinet6/in6_ifattach.c b/sys/netinet6/in6_ifattach.c index fe421c02513f..01d7925de43d 100644 --- a/sys/netinet6/in6_ifattach.c +++ b/sys/netinet6/in6_ifattach.c @@ -71,8 +71,6 @@ #include #include -VNET_DEFINE(unsigned long, in6_maxmtu) = 0; - #ifdef IP6_AUTO_LINKLOCAL VNET_DEFINE(int, ip6_auto_linklocal) = IP6_AUTO_LINKLOCAL; #else @@ -732,10 +730,6 @@ in6_ifattach(struct ifnet *ifp, struct ifnet *altifp) else ifa_free(&ia->ia_ifa); } - - /* update dynamically. */ - if (V_in6_maxmtu < ifp->if_mtu) - V_in6_maxmtu = ifp->if_mtu; } /* diff --git a/sys/netinet6/in6_var.h b/sys/netinet6/in6_var.h index 3d037bc644d8..e99e796a3140 100644 --- a/sys/netinet6/in6_var.h +++ b/sys/netinet6/in6_var.h @@ -551,9 +551,6 @@ do { \ ((ifp)->if_afdata[AF_INET6]))->in6_ifstat[ \ offsetof(struct in6_ifstat, tag) / sizeof(uint64_t)], 1);\ } while (/*CONSTCOND*/ 0) - -VNET_DECLARE(unsigned long, in6_maxmtu); -#define V_in6_maxmtu VNET(in6_maxmtu) #endif /* _KERNEL */ /* @@ -877,7 +874,6 @@ void in6_domifdetach(struct ifnet *, void *); int in6_domifmtu(struct ifnet *); struct rib_head *in6_inithead(uint32_t fibnum); void in6_detachhead(struct rib_head *rh); -void in6_setmaxmtu(void); int in6_if2idlen(struct ifnet *); struct in6_ifaddr *in6ifa_ifpforlinklocal(struct ifnet *, int); struct in6_ifaddr *in6ifa_ifpwithaddr(struct ifnet *, const struct in6_addr *); diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 887da1ebe21a..6ec5a8b54cf4 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -379,10 +379,6 @@ nd6_setmtu0(struct ifnet *ifp, struct nd_ifinfo *ndi) "new link MTU on %s (%lu) is too small for IPv6\n", if_name(ifp), (unsigned long)ndi->maxmtu); } - - if (ndi->maxmtu > V_in6_maxmtu) - in6_setmaxmtu(); /* check all interfaces just in case */ - } void diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index 845f9094f4c4..c145af7d3ffc 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -553,12 +553,8 @@ nd6_ra_input(struct mbuf *m, int off, int icmp6len) maxmtu = (ndi->maxmtu && ndi->maxmtu < ifp->if_mtu) ? ndi->maxmtu : ifp->if_mtu; if (mtu <= maxmtu) { - int change = (ndi->linkmtu != mtu); - - ndi->linkmtu = mtu; - if (change) { - /* in6_maxmtu may change */ - in6_setmaxmtu(); + if (ndi->linkmtu != mtu) { + ndi->linkmtu = mtu; rt_updatemtu(ifp); } } else {