From e773e4faa19c54c2f32ddd16add2919588488bd9 Mon Sep 17 00:00:00 2001 From: Brian Haley Date: Fri, 24 Aug 2007 23:16:08 -0700 Subject: [IPV6]: Add v4mapped address inline Add v4mapped address inline to avoid calls to ipv6_addr_type(). Signed-off-by: Brian Haley Signed-off-by: David S. Miller --- include/net/ipv6.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/net') diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 9059e0ed7fe3..9573c8d19153 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h @@ -377,6 +377,12 @@ static inline int ipv6_addr_any(const struct in6_addr *a) a->s6_addr32[2] | a->s6_addr32[3] ) == 0); } +static inline int ipv6_addr_v4mapped(const struct in6_addr *a) +{ + return ((a->s6_addr32[0] | a->s6_addr32[1]) == 0 && + a->s6_addr32[2] == htonl(0x0000ffff)); +} + /* * find the first different bit between two addresses * length of address must be a multiple of 32bits -- cgit v1.2.3-59-g8ed1b