Skip to content

Commit

Permalink
zebra: Correctly report metrics
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
donaldsharp committed Sep 25, 2024
1 parent 659cd66 commit e41ae0a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions zebra/zebra_snmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,23 +493,23 @@ static uint8_t *ipFwTable(struct variable *v, oid objid[], size_t *objid_len,
*val_len = sizeof(int);
return (uint8_t *)&result;
case IPFORWARDMETRIC1:
result = 0;
result = re->metric;
*val_len = sizeof(int);
return (uint8_t *)&result;
case IPFORWARDMETRIC2:
result = 0;
result = -1;
*val_len = sizeof(int);
return (uint8_t *)&result;
case IPFORWARDMETRIC3:
result = 0;
result = -1;
*val_len = sizeof(int);
return (uint8_t *)&result;
case IPFORWARDMETRIC4:
result = 0;
result = -1;
*val_len = sizeof(int);
return (uint8_t *)&result;
case IPFORWARDMETRIC5:
result = 0;
result = -1;
*val_len = sizeof(int);
return (uint8_t *)&result;
default:
Expand Down

0 comments on commit e41ae0a

Please sign in to comment.