FreeBSD/sys/netinet6/scope6.c
/*
 * ifp - note that this might be NULL
 */
note that this might be NULL
note that this might be NULL
void
scope6_setdefault(struct ifnet *ifp)
{
	SCOPE6_LOCK();
	if (ifp) {
		V_sid_default.s6id_list[IPV6_ADDR_SCOPE_INTFACELOCAL] =
			ifp->if_index;
		V_sid_default.s6id_list[IPV6_ADDR_SCOPE_LINKLOCAL] =
			ifp->if_index;
	} else {
		V_sid_default.s6id_list[IPV6_ADDR_SCOPE_INTFACELOCAL] = 0;
		V_sid_default.s6id_list[IPV6_ADDR_SCOPE_LINKLOCAL] = 0;
	}
	SCOPE6_UNLOCK();
}
void scope6_setdefault ( struct ifnet * ifp ) { SCOPE6_LOCK ( ) ; if ( ifp ) { V_sid_default . s6id_list [ IPV6_ADDR_SCOPE_INTFACELOCAL ] = ifp -> if_index ; V_sid_default . s6id_list [ IPV6_ADDR_SCOPE_LINKLOCAL ] = ifp -> if_index ; } else { V_sid_default . s6id_list [ IPV6_ADDR_SCOPE_INTFACELOCAL ] = 0 ; V_sid_default . s6id_list [ IPV6_ADDR_SCOPE_LINKLOCAL ] = 0 ; } SCOPE6_UNLOCK ( ) ; }
ifp - note that this might be NULL
ifp - note that this might be NULL
/*
	 * Currently, this function just sets the default "interfaces"
	 * and "links" according to the given interface.
	 * We might eventually have to separate the notion of "link" from
	 * "interface" and provide a user interface to set the default.
	 */