[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>
This commit is contained in:
Brian Haley
2007-08-24 23:16:08 -07:00
committed by David S. Miller
parent 6f4fc423b9
commit e773e4faa1
5 changed files with 12 additions and 6 deletions

View File

@@ -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