ip6_addr_test_zone macro
Test whether an IPv6 address is "zone-compatible" with a network interface. That is, test whether the network interface is part of the zone associated with the address. For efficiency, this macro is only ever called if the given address is either scoped or zoned, and thus, it need not test this. If an address is scoped but not zoned, or zoned and not scoped, it is considered not zone-compatible with any netif. This default implementation follows the default model of RFC 4007, where only interface-local and link-local scopes are defined, and the zone index of both of those scopes always equals the index of the network interface. As such, there is always only one matching netif for a specific zone index, but all call sites of this macro currently support multiple matching netifs as well (at no additional expense in the common case).
Syntax
#define ip6_addr_test_zone(ip6addr, netif) \
(ip6_addr_equals_zone((ip6addr), netif_get_index(netif)))
Arguments
ip6addr
the IPv6 address (const).
netif
the network interface (const).
Return value
1 if the address is scope-compatible with the netif, 0 if not.