From: Stephen Worley Date: Tue, 14 May 2019 17:37:45 +0000 (-0700) Subject: lib: nexthop-cmp return if gateways don't match X-Git-Tag: base_7.2~307^2~5 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=f932ce865fa1edc91c1f16856682705d82d92d65;p=matthieu%2Ffrr.git lib: nexthop-cmp return if gateways don't match Fix the cmp check the so that it returns the result if the gateways don't match. Signed-off-by: Stephen Worley --- diff --git a/lib/nexthop.c b/lib/nexthop.c index 120968f436..2f7ba7e3d0 100644 --- a/lib/nexthop.c +++ b/lib/nexthop.c @@ -92,13 +92,13 @@ int nexthop_cmp(const struct nexthop *next1, const struct nexthop *next2) break; case NEXTHOP_TYPE_IPV6: ret = memcmp(&next1->gate, &next2->gate, sizeof(union g_addr)); - if (!ret) + if (ret) return ret; break; case NEXTHOP_TYPE_IPV4_IFINDEX: case NEXTHOP_TYPE_IPV6_IFINDEX: ret = memcmp(&next1->gate, &next2->gate, sizeof(union g_addr)); - if (!ret) + if (ret) return ret; /* Intentional Fall-Through */ case NEXTHOP_TYPE_IFINDEX: