FreeBSD/sys/netinet/in.c
/*
 * Return a reference to the interface address which is different to
 * the supplied one but with same IP address value.
 */
Return a reference to the interface address which is different to
the supplied one but with same IP address value.
Return a reference to the interface address which is different to the supplied one but with same IP address value .
static struct in_ifaddr *
in_localip_more(struct in_ifaddr *ia)
{
	struct rm_priotracker in_ifa_tracker;
	in_addr_t in = IA_SIN(ia)->sin_addr.s_addr;
	struct in_ifaddr *it;
	IN_IFADDR_RLOCK(&in_ifa_tracker);
	LIST_FOREACH(it, INADDR_HASH(in), ia_hash) {
		if (it != ia && IA_SIN(it)->sin_addr.s_addr == in) {
			ifa_ref(&it->ia_ifa);
			IN_IFADDR_RUNLOCK(&in_ifa_tracker);
			return (it);
		}
	}
	IN_IFADDR_RUNLOCK(&in_ifa_tracker);
	return (NULL);
}
static struct in_ifaddr * in_localip_more ( struct in_ifaddr * ia ) { struct rm_priotracker in_ifa_tracker ; in_addr_t in = IA_SIN ( ia ) -> sin_addr . s_addr ; struct in_ifaddr * it ; IN_IFADDR_RLOCK ( & in_ifa_tracker ) ; LIST_FOREACH ( it , INADDR_HASH ( in ) , ia_hash ) { if ( it != ia && IA_SIN ( it ) -> sin_addr . s_addr == in ) { ifa_ref ( & it -> ia_ifa ) ; IN_IFADDR_RUNLOCK ( & in_ifa_tracker ) ; return ( it ) ; } } IN_IFADDR_RUNLOCK ( & in_ifa_tracker ) ; return ( NULL ) ; }
Return a reference to the interface address which is different to
 the supplied one but with same IP address value.
Return a reference to the interface address which is different to the supplied one but with same IP address value .