]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: include resolving nexthops in nhg hash
authorMark Stapp <mjs@cisco.com>
Mon, 27 Jan 2025 19:17:24 +0000 (14:17 -0500)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Tue, 11 Feb 2025 08:46:12 +0000 (08:46 +0000)
Ensure that the nhg hash comparison function includes all
nexthops, including recursive-resolving nexthops.

Signed-off-by: Mark Stapp <mjs@cisco.com>
(cherry picked from commit cb7cf73992847cfd4af796085bf14f2fdc4fa8db)

zebra/zebra_nhg.c

index 909f906f7c2f341f5d6df5fefdb95dedfb99e711..17951da45b81a9ddf324363b17cbc34b99268c6b 100644 (file)
@@ -559,8 +559,7 @@ bool zebra_nhg_hash_equal(const void *arg1, const void *arg2)
        /* Nexthops should be in-order, so we simply compare them in-place */
        for (nexthop1 = nhe1->nhg.nexthop, nexthop2 = nhe2->nhg.nexthop;
             nexthop1 && nexthop2;
-            nexthop1 = nexthop1->next, nexthop2 = nexthop2->next) {
-
+            nexthop1 = nexthop_next(nexthop1), nexthop2 = nexthop_next(nexthop2)) {
                if (!nhg_compare_nexthops(nexthop1, nexthop2))
                        return false;
        }
@@ -595,8 +594,7 @@ bool zebra_nhg_hash_equal(const void *arg1, const void *arg2)
        for (nexthop1 = nhe1->backup_info->nhe->nhg.nexthop,
             nexthop2 = nhe2->backup_info->nhe->nhg.nexthop;
             nexthop1 && nexthop2;
-            nexthop1 = nexthop1->next, nexthop2 = nexthop2->next) {
-
+            nexthop1 = nexthop_next(nexthop1), nexthop2 = nexthop_next(nexthop2)) {
                if (!nhg_compare_nexthops(nexthop1, nexthop2))
                        return false;
        }