FreeBSD/sys/netinet6/scope6.c
/*
 * This function is similar to sa6_checkzone, but it uses given ifp
 * to initialize sin6_scope_id.
 */
This function is similar to sa6_checkzone, but it uses given ifp
to initialize sin6_scope_id.
This function is similar to sa6_checkzone but it uses given ifp to initialize sin6_scope_id .
int
sa6_checkzone_ifp(struct ifnet *ifp, struct sockaddr_in6 *sa6)
{
	int scope;
	scope = in6_addrscope(&sa6->sin6_addr);
	if (scope == IPV6_ADDR_SCOPE_LINKLOCAL ||
	    scope == IPV6_ADDR_SCOPE_INTFACELOCAL) {
		if (sa6->sin6_scope_id == 0) {
			sa6->sin6_scope_id = in6_getscopezone(ifp, scope);
			return (0);
		} else if (sa6->sin6_scope_id != in6_getscopezone(ifp, scope))
			return (EADDRNOTAVAIL);
	}
	return (sa6_checkzone(sa6));
}
int sa6_checkzone_ifp ( struct ifnet * ifp , struct sockaddr_in6 * sa6 ) { int scope ; scope = in6_addrscope ( & sa6 -> sin6_addr ) ; if ( scope == IPV6_ADDR_SCOPE_LINKLOCAL || scope == IPV6_ADDR_SCOPE_INTFACELOCAL ) { if ( sa6 -> sin6_scope_id == 0 ) { sa6 -> sin6_scope_id = in6_getscopezone ( ifp , scope ) ; return ( 0 ) ; } else if ( sa6 -> sin6_scope_id != in6_getscopezone ( ifp , scope ) ) return ( EADDRNOTAVAIL ) ; } return ( sa6_checkzone ( sa6 ) ) ; }
This function is similar to sa6_checkzone, but it uses given ifp
 to initialize sin6_scope_id.
This function is similar to sa6_checkzone but it uses given ifp to initialize sin6_scope_id .