diff options
| author | Stephen Worley <sworley@cumulusnetworks.com> | 2019-05-14 10:37:45 -0700 |
|---|---|---|
| committer | Stephen Worley <sworley@cumulusnetworks.com> | 2019-05-23 12:21:15 -0400 |
| commit | f932ce865fa1edc91c1f16856682705d82d92d65 (patch) | |
| tree | 10be8c5c236952c93beef3c52103fe5385081a08 /lib/nexthop.c | |
| parent | 89dc316029c9167189f258ed9b79fec155da41cb (diff) | |
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 <sworley@cumulusnetworks.com>
Diffstat (limited to 'lib/nexthop.c')
| -rw-r--r-- | lib/nexthop.c | 4 |
1 files changed, 2 insertions, 2 deletions
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: |
