FreeBSD/sys/nlm/nlm_prot_impl.c
/*
 * Return non-zero if the address parts of the two sockaddrs are the
 * same.
 */
Return non-zero if the address parts of the two sockaddrs are the
same.
Return non - zero if the address parts of the two sockaddrs are the same .
static int
nlm_compare_addr(const struct sockaddr *a, const struct sockaddr *b)
{
	const struct sockaddr_in *a4, *b4;
#ifdef INET6
	const struct sockaddr_in6 *a6, *b6;
#endif
	if (a->sa_family != b->sa_family)
		return (FALSE);
	switch (a->sa_family) {
	case AF_INET:
		a4 = (const struct sockaddr_in *) a;
		b4 = (const struct sockaddr_in *) b;
		return !memcmp(&a4->sin_addr, &b4->sin_addr,
		    sizeof(a4->sin_addr));
#ifdef INET6
	case AF_INET6:
		a6 = (const struct sockaddr_in6 *) a;
		b6 = (const struct sockaddr_in6 *) b;
		return !memcmp(&a6->sin6_addr, &b6->sin6_addr,
		    sizeof(a6->sin6_addr));
#endif
	}
	return (0);
}
static int nlm_compare_addr ( const struct sockaddr * a , const struct sockaddr * b ) { const struct sockaddr_in * a4 , * b4 ; #ifdef INET6 const struct sockaddr_in6 * a6 , * b6 ; #endif if ( a -> sa_family != b -> sa_family ) return ( FALSE ) ; switch ( a -> sa_family ) { case AF_INET : a4 = ( const struct sockaddr_in * ) a ; b4 = ( const struct sockaddr_in * ) b ; return ! memcmp ( & a4 -> sin_addr , & b4 -> sin_addr , sizeof ( a4 -> sin_addr ) ) ; #ifdef INET6 case AF_INET6 : a6 = ( const struct sockaddr_in6 * ) a ; b6 = ( const struct sockaddr_in6 * ) b ; return ! memcmp ( & a6 -> sin6_addr , & b6 -> sin6_addr , sizeof ( a6 -> sin6_addr ) ) ; #endif } return ( 0 ) ; }
Return non-zero if the address parts of the two sockaddrs are the
 same.
Return non - zero if the address parts of the two sockaddrs are the same .