diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2024-09-25 12:09:40 -0400 |
|---|---|---|
| committer | Mergify <37929162+mergify[bot]@users.noreply.github.com> | 2024-09-25 18:51:42 +0000 |
| commit | 448b9b2a7e53fe28c541dc9fbafcbd8718ecd09d (patch) | |
| tree | 2fd72a34461b029ea438ab9b8f107d75544a4e56 /zebra/zebra_snmp.c | |
| parent | 9488f0cc4f58020c880f763af329bda0b709f631 (diff) | |
zebra: Correctly report metrics
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 e41ae0acc1940b568def5018efad3df019023f85)
Diffstat (limited to 'zebra/zebra_snmp.c')
| -rw-r--r-- | zebra/zebra_snmp.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/zebra/zebra_snmp.c b/zebra/zebra_snmp.c index 006f7b4fab..c9f27e70f8 100644 --- a/zebra/zebra_snmp.c +++ b/zebra/zebra_snmp.c @@ -491,23 +491,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: |
