From: Donald Sharp Date: Mon, 12 Jul 2021 18:23:51 +0000 (-0400) Subject: bgpd: hash compare functions never receive null values X-Git-Tag: frr-8.0.1~59^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=a3af447498e8f070fb8990744993c3259c3ba723;p=matthieu%2Ffrr.git bgpd: hash compare functions never receive null values 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 (cherry picked from commit 63245a641a028dc991de3a5266052e41d876ab20) --- diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c index 8c5829905e..a2f900d6e0 100644 --- a/bgpd/bgp_evpn.c +++ b/bgpd/bgp_evpn.c @@ -122,12 +122,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); } @@ -238,12 +232,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); }