FreeBSD/sys/netinet6/in6.c
/*
 * Find an IPv6 interface link-local address specific to an interface.
 * ifaddr is returned referenced.
 */
Find an IPv6 interface link-local address specific to an interface.
ifaddr is returned referenced.
Find an IPv6 interface link - local address specific to an interface . ifaddr is returned referenced .
struct in6_ifaddr *
in6ifa_ifpforlinklocal(struct ifnet *ifp, int ignoreflags)
{
	struct ifaddr *ifa;
	IF_ADDR_RLOCK(ifp);
	TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
		if (ifa->ifa_addr->sa_family != AF_INET6)
			continue;
		if (IN6_IS_ADDR_LINKLOCAL(IFA_IN6(ifa))) {
			if ((((struct in6_ifaddr *)ifa)->ia6_flags &
			    ignoreflags) != 0)
				continue;
			ifa_ref(ifa);
			break;
		}
	}
	IF_ADDR_RUNLOCK(ifp);
	return ((struct in6_ifaddr *)ifa);
}
struct in6_ifaddr * in6ifa_ifpforlinklocal ( struct ifnet * ifp , int ignoreflags ) { struct ifaddr * ifa ; IF_ADDR_RLOCK ( ifp ) ; TAILQ_FOREACH ( ifa , & ifp -> if_addrhead , ifa_link ) { if ( ifa -> ifa_addr -> sa_family != AF_INET6 ) continue ; if ( IN6_IS_ADDR_LINKLOCAL ( IFA_IN6 ( ifa ) ) ) { if ( ( ( ( struct in6_ifaddr * ) ifa ) -> ia6_flags & ignoreflags ) != 0 ) continue ; ifa_ref ( ifa ) ; break ; } } IF_ADDR_RUNLOCK ( ifp ) ; return ( ( struct in6_ifaddr * ) ifa ) ; }
Find an IPv6 interface link-local address specific to an interface.
Find an IPv6 interface link - local address specific to an interface .