summaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2005-11-08 09:38:12 -0800
committerDavid S. Miller <davem@davemloft.net>2005-11-08 09:38:12 -0800
commitb1cacb6820e0afc4aeeea67bcb5296a316862cad (patch)
treee7a563d832dfb028b31492ec76054ca30c2c8878 /include/net
parent971f359ddcb2e7a0d577479c7561bda407febe1b (diff)
downloadop-kernel-dev-b1cacb6820e0afc4aeeea67bcb5296a316862cad.zip
op-kernel-dev-b1cacb6820e0afc4aeeea67bcb5296a316862cad.tar.gz
[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>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/ipv6.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 98661fa..6addb4d 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -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)
OpenPOWER on IntegriCloud