summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike RE Mallin <mremallin@gmail.com>2024-05-31 15:42:12 +0200
committerMike RE Mallin <mremallin@gmail.com>2024-05-31 16:27:22 +0200
commitf381bc21482d0177cb81a8fe4ff687470dde2c3a (patch)
tree9b098a490bc061a35e206237dc86f58de66dc1af
parentlib: Add SET_IPADDR_NONE macro (diff)
downloadfrr-f381bc21482d0177cb81a8fe4ff687470dde2c3a.tar.xz
frr-f381bc21482d0177cb81a8fe4ff687470dde2c3a.zip
lib: Add ipaddr_is_same to compare IPv6 addresses
Signed-off-by: Mike RE Mallin <mremallin@gmail.com>
-rw-r--r--lib/ipaddr.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/ipaddr.h b/lib/ipaddr.h
index e8f873747..76c7c15ff 100644
--- a/lib/ipaddr.h
+++ b/lib/ipaddr.h
@@ -166,6 +166,12 @@ static inline bool ipaddr_is_zero(const struct ipaddr *ip)
return true;
}
+static inline bool ipaddr_is_same(const struct ipaddr *ip1,
+ const struct ipaddr *ip2)
+{
+ return ipaddr_cmp(ip1, ip2) == 0;
+}
+
#ifdef _FRR_ATTRIBUTE_PRINTFRR
#pragma FRR printfrr_ext "%pIA" (struct ipaddr *)
#endif