summaryrefslogtreecommitdiff
path: root/lib/prefix.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/prefix.h')
-rw-r--r--lib/prefix.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/prefix.h b/lib/prefix.h
index 42394ec61c..f9eef28a0b 100644
--- a/lib/prefix.h
+++ b/lib/prefix.h
@@ -594,6 +594,15 @@ static inline int is_default_host_route(const struct prefix *p)
return 0;
}
+static inline bool is_ipv6_global_unicast(const struct in6_addr *p)
+{
+ if (IN6_IS_ADDR_UNSPECIFIED(p) || IN6_IS_ADDR_LOOPBACK(p) ||
+ IN6_IS_ADDR_LINKLOCAL(p) || IN6_IS_ADDR_MULTICAST(p))
+ return false;
+
+ return true;
+}
+
/* IPv6 scope values, usable for IPv4 too (cf. below) */
/* clang-format off */
enum {