]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/bgp_lcommunity.c
Merge pull request #3327 from adeg/feature/bgp-lu-auto-labels
[mirror_frr.git] / bgpd / bgp_lcommunity.c
index 3e160bc56ed95b55d65dbe113400c810dcc04c61..cfc9af7777e81a0827bb606c1e12c571849733b7 100644 (file)
@@ -313,11 +313,17 @@ unsigned int lcommunity_hash_make(void *arg)
 }
 
 /* Compare two Large Communities Attribute structure.  */
-int lcommunity_cmp(const void *arg1, const void *arg2)
+bool lcommunity_cmp(const void *arg1, const void *arg2)
 {
        const struct lcommunity *lcom1 = arg1;
        const struct lcommunity *lcom2 = arg2;
 
+       if (lcom1 == NULL && lcom2 == NULL)
+               return 1;
+
+       if (lcom1 == NULL || lcom2 == NULL)
+               return 0;
+
        return (lcom1->size == lcom2->size
                && memcmp(lcom1->val, lcom2->val, lcom_length(lcom1)) == 0);
 }