summaryrefslogtreecommitdiff
path: root/lib/nexthop_group.c
diff options
context:
space:
mode:
authorStephen Worley <sworley@cumulusnetworks.com>2019-09-03 14:46:14 -0400
committerStephen Worley <sworley@cumulusnetworks.com>2019-10-25 11:13:43 -0400
commit9c387098eb147a628857982639258cf7d4d9a090 (patch)
tree95665b994559888fe01fe45e05bd3a9f877ab6ff /lib/nexthop_group.c
parent737170f5bf7e9f999543c30eff4824646885652b (diff)
lib: Fix nexthop_group_equal*() NULL check
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>
Diffstat (limited to 'lib/nexthop_group.c')
-rw-r--r--lib/nexthop_group.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/nexthop_group.c b/lib/nexthop_group.c
index 86c885012c..54868d7fca 100644
--- a/lib/nexthop_group.c
+++ b/lib/nexthop_group.c
@@ -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))