]> git.proxmox.com Git - mirror_frr.git/commitdiff
lib: Fix nexthop_group_equal*() NULL check
authorStephen Worley <sworley@cumulusnetworks.com>
Tue, 3 Sep 2019 18:46:14 +0000 (14:46 -0400)
committerStephen Worley <sworley@cumulusnetworks.com>
Fri, 25 Oct 2019 15:13:43 +0000 (11:13 -0400)
Logic error on the second null check for nexthop groups
passed to the `nexthop_group_equal*() functions. This fixes it.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
lib/nexthop_group.c

index 86c885012c838309c9bb7808b0d95da2fec87b6e..54868d7fca78678dcfe29960a7471f7790176ad2 100644 (file)
@@ -142,7 +142,7 @@ bool nexthop_group_equal_no_recurse(const struct nexthop_group *nhg1,
        if (nhg1 && !nhg2)
                return false;
 
-       if (!nhg1 && !nhg2)
+       if (!nhg1 && nhg2)
                return false;
 
        if (nexthop_group_nexthop_num_no_recurse(nhg1)
@@ -168,7 +168,7 @@ bool nexthop_group_equal(const struct nexthop_group *nhg1,
        if (nhg1 && !nhg2)
                return false;
 
-       if (!nhg1 && !nhg2)
+       if (!nhg1 && nhg2)
                return false;
 
        if (nexthop_group_nexthop_num(nhg1) != nexthop_group_nexthop_num(nhg2))