aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAlexander V. Chernikov <melifaro@FreeBSD.org>2023-03-03 16:30:15 +0000
committerAlexander V. Chernikov <melifaro@FreeBSD.org>2023-03-06 15:08:08 +0000
commit66bdbcd544d57fa629954d1e0b32fe21ae66a9b7 (patch)
treeae42871714eb46d6bee21f49840646332e3a60b3 /sys
parent062f2818c1ad35bdc3d520c7572e3cefda657770 (diff)
downloadsrc-66bdbcd544d57fa629954d1e0b32fe21ae66a9b7.tar.gz
src-66bdbcd544d57fa629954d1e0b32fe21ae66a9b7.zip
Diffstat (limited to 'sys')
-rw-r--r--sys/net/if.c17
-rw-r--r--sys/net/if_bridge.c16
-rw-r--r--sys/net/if_lagg.c16
-rw-r--r--sys/net/if_var.h1
-rw-r--r--sys/net/if_vlan.c16
5 files changed, 18 insertions, 48 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index bc13cdaf05f5..58711061eb5e 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -2853,12 +2853,8 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, struct thread *td)
/*
* If the link MTU changed, do network layer specific procedure.
*/
- if (ifp->if_mtu != oldmtu) {
-#ifdef INET6
- nd6_setmtu(ifp);
-#endif
- rt_updatemtu(ifp);
- }
+ if (ifp->if_mtu != oldmtu)
+ if_notifymtu(ifp);
break;
}
@@ -4470,6 +4466,15 @@ if_setmtu(if_t ifp, int mtu)
return (0);
}
+void
+if_notifymtu(if_t ifp)
+{
+#ifdef INET6
+ nd6_setmtu(ifp);
+#endif
+ rt_updatemtu(ifp);
+}
+
int
if_getmtu(const if_t ifp)
{
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
index 9f99434dd4e0..60a1683c74ae 100644
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -136,14 +136,6 @@ __FBSDID("$FreeBSD$");
#include <net/route.h>
-#ifdef INET6
-/*
- * XXX: declare here to avoid to include many inet6 related files..
- * should be more generalized?
- */
-extern void nd6_setmtu(struct ifnet *);
-#endif
-
/*
* Size of the route hash table. Must be a power of two.
*/
@@ -910,12 +902,8 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
* Bridge MTU may change during addition of the first port.
* If it did, do network layer specific procedure.
*/
- if (ifp->if_mtu != oldmtu) {
-#ifdef INET6
- nd6_setmtu(ifp);
-#endif
- rt_updatemtu(ifp);
- }
+ if (ifp->if_mtu != oldmtu)
+ if_notifymtu(ifp);
if (bc->bc_flags & BC_F_COPYOUT)
error = copyout(&args, ifd->ifd_data, ifd->ifd_len);
diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c
index c649a2c3372e..1ac8492834fc 100644
--- a/sys/net/if_lagg.c
+++ b/sys/net/if_lagg.c
@@ -77,14 +77,6 @@ __FBSDID("$FreeBSD$");
#include <net/if_lagg.h>
#include <net/ieee8023ad_lacp.h>
-#ifdef INET6
-/*
- * XXX: declare here to avoid to include many inet6 related files..
- * should be more generalized?
- */
-extern void nd6_setmtu(struct ifnet *);
-#endif
-
#ifdef DEV_NETMAP
MODULE_DEPEND(if_lagg, netmap, 1, 1, 1);
#endif
@@ -1636,12 +1628,8 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
* LAGG MTU may change during addition of the first port.
* If it did, do network layer specific procedure.
*/
- if (ifp->if_mtu != oldmtu) {
-#ifdef INET6
- nd6_setmtu(ifp);
-#endif
- rt_updatemtu(ifp);
- }
+ if (ifp->if_mtu != oldmtu)
+ if_notifymtu(ifp);
VLAN_CAPABILITIES(ifp);
break;
diff --git a/sys/net/if_var.h b/sys/net/if_var.h
index 7200cd5634d3..c9b2de736d10 100644
--- a/sys/net/if_var.h
+++ b/sys/net/if_var.h
@@ -618,6 +618,7 @@ void if_setbroadcastaddr(if_t ifp, const uint8_t *);
int if_setmtu(if_t ifp, int mtu);
int if_getmtu(const if_t ifp);
int if_getmtu_family(const if_t ifp, int family);
+void if_notifymtu(if_t ifp);
int if_setflagbits(if_t ifp, int set, int clear);
int if_setflags(if_t ifp, int flags);
int if_getflags(const if_t ifp);
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c
index d8be44b105f1..0f2ded3f6040 100644
--- a/sys/net/if_vlan.c
+++ b/sys/net/if_vlan.c
@@ -85,14 +85,6 @@ __FBSDID("$FreeBSD$");
#include <netinet/if_ether.h>
#endif
-#ifdef INET6
-/*
- * XXX: declare here to avoid to include many inet6 related files..
- * should be more generalized?
- */
-extern void nd6_setmtu(struct ifnet *);
-#endif
-
#define VLAN_DEF_HWIDTH 4
#define VLAN_IFFLAGS (IFF_BROADCAST | IFF_MULTICAST)
@@ -2110,12 +2102,8 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
* VLAN MTU may change during addition of the vlandev.
* If it did, do network layer specific procedure.
*/
- if (ifp->if_mtu != oldmtu) {
-#ifdef INET6
- nd6_setmtu(ifp);
-#endif
- rt_updatemtu(ifp);
- }
+ if (ifp->if_mtu != oldmtu)
+ if_notifymtu(ifp);
break;
case SIOCGETVLAN: