diff options
author | Brian Haley <brian.haley@hp.com> | 2007-08-25 02:16:08 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:48:32 -0400 |
commit | e773e4faa19c54c2f32ddd16add2919588488bd9 (patch) | |
tree | 316395a9c687155362913ec1c588c0217233f67e /include/net/ipv6.h | |
parent | 6f4fc423b96c8fdf6f5c8b8ad79b75b7fb5a5c59 (diff) |
[IPV6]: Add v4mapped address inline
Add v4mapped address inline to avoid calls to ipv6_addr_type().
Signed-off-by: Brian Haley <brian.haley@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/ipv6.h')
-rw-r--r-- | include/net/ipv6.h | 6 |
1 files changed, 6 insertions, 0 deletions
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) | |||
377 | a->s6_addr32[2] | a->s6_addr32[3] ) == 0); | 377 | a->s6_addr32[2] | a->s6_addr32[3] ) == 0); |
378 | } | 378 | } |
379 | 379 | ||
380 | static inline int ipv6_addr_v4mapped(const struct in6_addr *a) | ||
381 | { | ||
382 | return ((a->s6_addr32[0] | a->s6_addr32[1]) == 0 && | ||
383 | a->s6_addr32[2] == htonl(0x0000ffff)); | ||
384 | } | ||
385 | |||
380 | /* | 386 | /* |
381 | * find the first different bit between two addresses | 387 | * find the first different bit between two addresses |
382 | * length of address must be a multiple of 32bits | 388 | * length of address must be a multiple of 32bits |