FreeBSD/sys/netinet6/in6.c
/*
 * find the internet address corresponding to a given address.
 * ifaddr is returned referenced.
 */
find the internet address corresponding to a given address.
ifaddr is returned referenced.
find the internet address corresponding to a given address . ifaddr is returned referenced .
struct in6_ifaddr *
in6ifa_ifwithaddr(const struct in6_addr *addr, uint32_t zoneid)
{
	struct rm_priotracker in6_ifa_tracker;
	struct in6_ifaddr *ia;
	IN6_IFADDR_RLOCK(&in6_ifa_tracker);
	LIST_FOREACH(ia, IN6ADDR_HASH(addr), ia6_hash) {
		if (IN6_ARE_ADDR_EQUAL(IA6_IN6(ia), addr)) {
			if (zoneid != 0 &&
			    zoneid != ia->ia_addr.sin6_scope_id)
				continue;
			ifa_ref(&ia->ia_ifa);
			break;
		}
	}
	IN6_IFADDR_RUNLOCK(&in6_ifa_tracker);
	return (ia);
}
struct in6_ifaddr * in6ifa_ifwithaddr ( const struct in6_addr * addr , uint32_t zoneid ) { struct rm_priotracker in6_ifa_tracker ; struct in6_ifaddr * ia ; IN6_IFADDR_RLOCK ( & in6_ifa_tracker ) ; LIST_FOREACH ( ia , IN6ADDR_HASH ( addr ) , ia6_hash ) { if ( IN6_ARE_ADDR_EQUAL ( IA6_IN6 ( ia ) , addr ) ) { if ( zoneid != 0 && zoneid != ia -> ia_addr . sin6_scope_id ) continue ; ifa_ref ( & ia -> ia_ifa ) ; break ; } } IN6_IFADDR_RUNLOCK ( & in6_ifa_tracker ) ; return ( ia ) ; }
find the internet address corresponding to a given address.
find the internet address corresponding to a given address .