ipv6: Make ipv6_addr_is_XXX() return boolean.
ipv6_addr_is_{multicast,ll_all_nodes,ll_all_routers,isatap}() return boolean. Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
ad327910c4
commit
b27b28cb44
1 changed files with 4 additions and 4 deletions
|
@ -281,26 +281,26 @@ static inline void addrconf_addr_solict_mult(const struct in6_addr *addr,
|
||||||
htonl(0xFF000000) | addr->s6_addr32[3]);
|
htonl(0xFF000000) | addr->s6_addr32[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int ipv6_addr_is_multicast(const struct in6_addr *addr)
|
static inline bool ipv6_addr_is_multicast(const struct in6_addr *addr)
|
||||||
{
|
{
|
||||||
return (addr->s6_addr32[0] & htonl(0xFF000000)) == htonl(0xFF000000);
|
return (addr->s6_addr32[0] & htonl(0xFF000000)) == htonl(0xFF000000);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int ipv6_addr_is_ll_all_nodes(const struct in6_addr *addr)
|
static inline bool ipv6_addr_is_ll_all_nodes(const struct in6_addr *addr)
|
||||||
{
|
{
|
||||||
return ((addr->s6_addr32[0] ^ htonl(0xff020000)) |
|
return ((addr->s6_addr32[0] ^ htonl(0xff020000)) |
|
||||||
addr->s6_addr32[1] | addr->s6_addr32[2] |
|
addr->s6_addr32[1] | addr->s6_addr32[2] |
|
||||||
(addr->s6_addr32[3] ^ htonl(0x00000001))) == 0;
|
(addr->s6_addr32[3] ^ htonl(0x00000001))) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int ipv6_addr_is_ll_all_routers(const struct in6_addr *addr)
|
static inline bool ipv6_addr_is_ll_all_routers(const struct in6_addr *addr)
|
||||||
{
|
{
|
||||||
return ((addr->s6_addr32[0] ^ htonl(0xff020000)) |
|
return ((addr->s6_addr32[0] ^ htonl(0xff020000)) |
|
||||||
addr->s6_addr32[1] | addr->s6_addr32[2] |
|
addr->s6_addr32[1] | addr->s6_addr32[2] |
|
||||||
(addr->s6_addr32[3] ^ htonl(0x00000002))) == 0;
|
(addr->s6_addr32[3] ^ htonl(0x00000002))) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int ipv6_addr_is_isatap(const struct in6_addr *addr)
|
static inline bool ipv6_addr_is_isatap(const struct in6_addr *addr)
|
||||||
{
|
{
|
||||||
return (addr->s6_addr32[2] | htonl(0x02000000)) == htonl(0x02005EFE);
|
return (addr->s6_addr32[2] | htonl(0x02000000)) == htonl(0x02005EFE);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue