]> git.proxmox.com Git - mirror_frr.git/commitdiff
lib: nexthop-cmp return if gateways don't match
authorStephen Worley <sworley@cumulusnetworks.com>
Tue, 14 May 2019 17:37:45 +0000 (10:37 -0700)
committerStephen Worley <sworley@cumulusnetworks.com>
Thu, 23 May 2019 16:21:15 +0000 (12:21 -0400)
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>
lib/nexthop.c

index 120968f43662c50639b41a702efea6c993a136da..2f7ba7e3d00cf10e222669b5c160682c1e7443d7 100644 (file)
@@ -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: