summaryrefslogtreecommitdiffstats
path: root/lib/ipaddr.h
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2020-02-26 18:14:21 +0100
committerQuentin Young <qlyoung@cumulusnetworks.com>2020-02-26 18:14:21 +0100
commitf2d72fcdc51622c39ffa14a63a7bc81c1276e591 (patch)
tree5cf363c6f48133f7f6d29f3fb08781cb685ef2e7 /lib/ipaddr.h
parentMerge pull request #5838 from volta-networks/fix_isis_ifdown (diff)
downloadfrr-f2d72fcdc51622c39ffa14a63a7bc81c1276e591.tar.xz
frr-f2d72fcdc51622c39ffa14a63a7bc81c1276e591.zip
lib: fix ipaddr_isset
Meaning inverted by mistake Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib/ipaddr.h')
-rw-r--r--lib/ipaddr.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/ipaddr.h b/lib/ipaddr.h
index 6bd614044..c6372f1ab 100644
--- a/lib/ipaddr.h
+++ b/lib/ipaddr.h
@@ -119,10 +119,13 @@ static inline void ipv4_mapped_ipv6_to_ipv4(struct in6_addr *in6,
memcpy(in, (char *)in6 + 12, sizeof(struct in_addr));
}
+/*
+ * Check if a struct ipaddr has nonzero value
+ */
static inline bool ipaddr_isset(struct ipaddr *ip)
{
static struct ipaddr a = {};
- return (0 == memcmp(&a, ip, sizeof(struct ipaddr)));
+ return (0 != memcmp(&a, ip, sizeof(struct ipaddr)));
}
#ifdef __cplusplus