]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: hash compare functions never receive null values 9036/head
authorDonald Sharp <sharpd@nvidia.com>
Mon, 12 Jul 2021 18:23:51 +0000 (14:23 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Mon, 12 Jul 2021 18:23:51 +0000 (14:23 -0400)
There is no need to test for null values in the hash compare
function as that we are guaranteed to send in data in
the hash compare functions.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
bgpd/bgp_evpn.c

index c99f539c7b72ec6d9e157f610b0a12a22b7c61b5..448c0009c575747be631f9e82b3066aff081231f 100644 (file)
@@ -145,12 +145,6 @@ static bool vrf_import_rt_hash_cmp(const void *p1, const void *p2)
        const struct vrf_irt_node *irt1 = p1;
        const struct vrf_irt_node *irt2 = p2;
 
-       if (irt1 == NULL && irt2 == NULL)
-               return true;
-
-       if (irt1 == NULL || irt2 == NULL)
-               return false;
-
        return (memcmp(irt1->rt.val, irt2->rt.val, ECOMMUNITY_SIZE) == 0);
 }
 
@@ -261,12 +255,6 @@ static bool import_rt_hash_cmp(const void *p1, const void *p2)
        const struct irt_node *irt1 = p1;
        const struct irt_node *irt2 = p2;
 
-       if (irt1 == NULL && irt2 == NULL)
-               return true;
-
-       if (irt1 == NULL || irt2 == NULL)
-               return false;
-
        return (memcmp(irt1->rt.val, irt2->rt.val, ECOMMUNITY_SIZE) == 0);
 }