From 9c387098eb147a628857982639258cf7d4d9a090 Mon Sep 17 00:00:00 2001 From: Stephen Worley Date: Tue, 3 Sep 2019 14:46:14 -0400 Subject: [PATCH] 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 --- lib/nexthop_group.c | 4 ++-- 1 file 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)) -- 2.39.5