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 #16918

Merged
merged 4 commits into from
Sep 25, 2024
Merged

Conversation

donaldsharp
Copy link
Member

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.

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 <[email protected]>
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 <[email protected]>
Add missing isis and eigrp proto translations.

Signed-off-by: Donald Sharp <[email protected]>
@ton31337
Copy link
Member

@Mergifyio backport stable/10.1 stable/10.0 stable/9.1 stable/9.0 stable/8.5 stable/8.4

Copy link

mergify bot commented Sep 25, 2024

backport stable/10.1 stable/10.0 stable/9.1 stable/9.0 stable/8.5 stable/8.4

✅ Backports have been created

@ton31337 ton31337 merged commit 8d76a02 into FRRouting:master Sep 25, 2024
14 checks passed
donaldsharp added a commit that referenced this pull request Sep 25, 2024
donaldsharp added a commit that referenced this pull request Sep 25, 2024
donaldsharp added a commit that referenced this pull request Oct 1, 2024
donaldsharp added a commit that referenced this pull request Oct 1, 2024
donaldsharp added a commit that referenced this pull request Oct 1, 2024
donaldsharp added a commit that referenced this pull request Oct 1, 2024
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.

2 participants