diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2024-09-25 12:06:29 -0400 |
|---|---|---|
| committer | Mergify <37929162+mergify[bot]@users.noreply.github.com> | 2024-09-25 18:51:40 +0000 |
| commit | 7cd5834d1619f91fcde2a05d5157200f120dba64 (patch) | |
| tree | a8640cef28c1bc419d3fedee8a60b74996f841d9 /zebra | |
| parent | 6cb1879218ecb6aad84c5db0622a380caa21fd1a (diff) | |
zebra: Fix snmp walk of zebra rib
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)
Diffstat (limited to 'zebra')
| -rw-r--r-- | zebra/zebra_snmp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/zebra/zebra_snmp.c b/zebra/zebra_snmp.c index 1c6d58159e..5a99ac0500 100644 --- a/zebra/zebra_snmp.c +++ b/zebra/zebra_snmp.c @@ -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; |
