]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: Fix snmp walk of zebra rib
authorDonald Sharp <sharpd@nvidia.com>
Wed, 25 Sep 2024 16:06:29 +0000 (12:06 -0400)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Wed, 25 Sep 2024 18:51:40 +0000 (18:51 +0000)
The snmp walk of the zebra rib was skipping entries
because in_addr_cmp was replaced with a prefix_cmp
which worked slightly differently causing parts
of the zebra rib tree to be skipped.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit ecd9d441b082e3f24139eb96915b18fc17996c08)

zebra/zebra_snmp.c

index 1c6d58159e79bf0c0cb63ed9d6166f0c21a693cf..5a99ac05009e5f6d02abaa24b40b84da4d54d1e8 100644 (file)
@@ -253,9 +253,11 @@ static void check_replace(struct route_node *np2, struct route_entry *re2,
                return;
        }
 
-       if (prefix_cmp(&(*np)->p, &np2->p) < 0)
+       if (in_addr_cmp((uint8_t *)&(*np)->p.u.prefix4,
+                       (uint8_t *)&np2->p.u.prefix4) < 0)
                return;
-       if (prefix_cmp(&(*np)->p, &np2->p) > 0) {
+       if (in_addr_cmp((uint8_t *)&(*np)->p.u.prefix4,
+                       (uint8_t *)&np2->p.u.prefix4) > 0) {
                *np = np2;
                *re = re2;
                return;