Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zebra snmp fixes (backport #16918) #16924

Merged
merged 4 commits into from
Oct 1, 2024

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented Sep 25, 2024

Was playing with snmp and noticed some issues with zebra's implementation of it.

a) snmp walk was wrong. Whomever wrote this found a new and interesting way to make something simple hard. Further work should be done to optimize this, just putting this back into working order since I broke it in 2019
b) Who would think to walk the individual bytes of a struct to set them to 0 in a loop when memset is available?
c) Metrics are not being reported at all. Let's return them
d) Some missing proto translations. The values are weird so we don't get everything.


This is an automatic backport of pull request #16918 done by Mergify.

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 ecd9d44)
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 659cd66)
Report the routes metric in IPFORWARDMETRIC1 and return
-1 for the other metrics as required by the IP-FORWARD-MIB.

inetCidrRouteMetric2 OBJECT-TYPE
    SYNTAX     Integer32
    MAX-ACCESS read-create
    STATUS     current
    DESCRIPTION
           "An alternate routing metric for this route.  The
            semantics of this metric are determined by the routing-
            protocol specified in the route's inetCidrRouteProto
            value.  If this metric is not used, its value should be
            set to -1."
    DEFVAL { -1 }
    ::= { inetCidrRouteEntry 13 }

I've included metric2 but it's the same for all of them.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit e41ae0a)
Add missing isis and eigrp proto translations.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit f53dde0)
@mergify mergify bot mentioned this pull request Sep 25, 2024
@frrbot frrbot bot added the zebra label Sep 25, 2024
@donaldsharp donaldsharp merged commit 7d4eeb3 into stable/8.4 Oct 1, 2024
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant