FreeBSD/sys/netinet6/in6.c
/*
 * Calculate max IPv6 MTU through all the interfaces and store it
 * to in6_maxmtu.
 */
Calculate max IPv6 MTU through all the interfaces and store it
to in6_maxmtu.
Calculate max IPv6 MTU through all the interfaces and store it to in6_maxmtu .
void
in6_setmaxmtu(void)
{
	unsigned long maxmtu = 0;
	struct ifnet *ifp;
	IFNET_RLOCK_NOSLEEP();
	TAILQ_FOREACH(ifp, &V_ifnet, if_link) {
		if (!ifp->if_afdata[AF_INET6])
			continue;
		if ((ifp->if_flags & IFF_LOOPBACK) == 0 &&
		    IN6_LINKMTU(ifp) > maxmtu)
			maxmtu = IN6_LINKMTU(ifp);
	}
	IFNET_RUNLOCK_NOSLEEP();
	if (maxmtu)	
		V_in6_maxmtu = maxmtu;
}
void in6_setmaxmtu ( void ) { unsigned long maxmtu = 0 ; struct ifnet * ifp ; IFNET_RLOCK_NOSLEEP ( ) ; TAILQ_FOREACH ( ifp , & V_ifnet , if_link ) { if ( ! ifp -> if_afdata [ AF_INET6 ] ) continue ; if ( ( ifp -> if_flags & IFF_LOOPBACK ) == 0 && IN6_LINKMTU ( ifp ) > maxmtu ) maxmtu = IN6_LINKMTU ( ifp ) ; } IFNET_RUNLOCK_NOSLEEP ( ) ; if ( maxmtu ) V_in6_maxmtu = maxmtu ; }
Calculate max IPv6 MTU through all the interfaces and store it
 to in6_maxmtu.
Calculate max IPv6 MTU through all the interfaces and store it to in6_maxmtu .
/* this function can be called during ifnet initialization */ /* update only when maxmtu is positive */