]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: fix ipaddr_isset
authorQuentin Young <qlyoung@cumulusnetworks.com>
Wed, 26 Feb 2020 17:14:21 +0000 (12:14 -0500)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Wed, 26 Feb 2020 17:14:21 +0000 (12:14 -0500)
Meaning inverted by mistake

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
lib/ipaddr.h

index 6bd614044c768d27d9979429b6ca39d2651e0712..c6372f1abb3dbd8b138747bf4cbb344037ebc853 100644 (file)
@@ -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