2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

lib: Add ipv6 helper functions.

ipv6_addr_is_set is going to be used by next patches.

[cascardo: compare with in6addr_any in ipv6_addr_is_set]
[cascardo: keep only ipv6_addr_is_* functions]

Signed-off-by: Jiri Benc <jbenc@redhat.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
Jiri Benc
2015-09-29 19:10:54 -03:00
committed by Ben Pfaff
parent 754c1feb20
commit 8c46162bb4

View File

@@ -871,6 +871,14 @@ static inline bool ipv6_is_all_hosts(const struct in6_addr *addr) {
return ipv6_addr_equals(addr, &in6addr_all_hosts);
}
static inline bool ipv6_addr_is_set(const struct in6_addr *addr) {
return !ipv6_addr_equals(addr, &in6addr_any);
}
static inline bool ipv6_addr_is_multicast(const struct in6_addr *ip) {
return ip->s6_addr[0] == 0xff;
}
static inline void
in6_addr_set_mapped_ipv4(struct in6_addr *addr, ovs_be32 ip4)
{