diff --git a/sys/net/if.c b/sys/net/if.c --- a/sys/net/if.c +++ b/sys/net/if.c @@ -2853,12 +2853,8 @@ /* * 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 @@ 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 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -136,14 +136,6 @@ #include -#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 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 --- a/sys/net/if_lagg.c +++ b/sys/net/if_lagg.c @@ -77,14 +77,6 @@ #include #include -#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 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 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -618,6 +618,7 @@ 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 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -85,14 +85,6 @@ #include #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 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: