FreeBSD/sys/netinet6/in6.c
/*
 * perform DAD when interface becomes IFF_UP.
 */
perform DAD when interface becomes IFF_UP.
perform DAD when interface becomes IFF_UP .
void
in6_if_up(struct ifnet *ifp)
{
	struct ifaddr *ifa;
	struct in6_ifaddr *ia;
	IF_ADDR_RLOCK(ifp);
	TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
		if (ifa->ifa_addr->sa_family != AF_INET6)
			continue;
		ia = (struct in6_ifaddr *)ifa;
		if (ia->ia6_flags & IN6_IFF_TENTATIVE) {
			nd6_dad_start(ifa,
			    arc4random() % (MAX_RTR_SOLICITATION_DELAY * hz));
		}
	}
	IF_ADDR_RUNLOCK(ifp);
	in6_ifattach(ifp, NULL);
}
void in6_if_up ( struct ifnet * ifp ) { struct ifaddr * ifa ; struct in6_ifaddr * ia ; IF_ADDR_RLOCK ( ifp ) ; TAILQ_FOREACH ( ifa , & ifp -> if_addrhead , ifa_link ) { if ( ifa -> ifa_addr -> sa_family != AF_INET6 ) continue ; ia = ( struct in6_ifaddr * ) ifa ; if ( ia -> ia6_flags & IN6_IFF_TENTATIVE ) { nd6_dad_start ( ifa , arc4random ( ) % ( MAX_RTR_SOLICITATION_DELAY * hz ) ) ; } } IF_ADDR_RUNLOCK ( ifp ) ; in6_ifattach ( ifp , NULL ) ; }
perform DAD when interface becomes IFF_UP.
perform DAD when interface becomes IFF_UP .
/*
			 * The TENTATIVE flag was likely set by hand
			 * beforehand, implicitly indicating the need for DAD.
			 * We may be able to skip the random delay in this
			 * case, but we impose delays just in case.
			 */ /*
	 * special cases, like 6to4, are handled in in6_ifattach
	 */