[IPV6]: Make ipv6_addr_type() more generic so that we can use it for source address selection.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
971f359ddc
commit
b1cacb6820
@@ -252,12 +252,25 @@ typedef int (*inet_getfrag_t) (const void *data,
|
||||
char *,
|
||||
unsigned int, unsigned int);
|
||||
|
||||
|
||||
extern int ipv6_addr_type(const struct in6_addr *addr);
|
||||
extern int __ipv6_addr_type(const struct in6_addr *addr);
|
||||
static inline int ipv6_addr_type(const struct in6_addr *addr)
|
||||
{
|
||||
return __ipv6_addr_type(addr) & 0xffff;
|
||||
}
|
||||
|
||||
static inline int ipv6_addr_scope(const struct in6_addr *addr)
|
||||
{
|
||||
return ipv6_addr_type(addr) & IPV6_ADDR_SCOPE_MASK;
|
||||
return __ipv6_addr_type(addr) & IPV6_ADDR_SCOPE_MASK;
|
||||
}
|
||||
|
||||
static inline int __ipv6_addr_src_scope(int type)
|
||||
{
|
||||
return (type == IPV6_ADDR_ANY ? __IPV6_ADDR_SCOPE_INVALID : (type >> 16));
|
||||
}
|
||||
|
||||
static inline int ipv6_addr_src_scope(const struct in6_addr *addr)
|
||||
{
|
||||
return __ipv6_addr_src_scope(__ipv6_addr_type(addr));
|
||||
}
|
||||
|
||||
static inline int ipv6_addr_cmp(const struct in6_addr *a1, const struct in6_addr *a2)
|
||||
|
Reference in New Issue
Block a user