summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_mplsvpn_snmp.c
diff options
context:
space:
mode:
authorLouis Scalbert <louis.scalbert@6wind.com>2022-11-03 12:01:51 +0100
committerLouis Scalbert <louis.scalbert@6wind.com>2022-12-15 17:10:59 +0100
commit6f27419975c3f5475b451f4f3b2728eaac9f632e (patch)
treebaf1f35b64598840b44bbfdadfca31063b460804 /bgpd/bgp_mplsvpn_snmp.c
parentbgpd: display the IGP metric of the ultimate path in route details (diff)
downloadfrr-6f27419975c3f5475b451f4f3b2728eaac9f632e.tar.xz
frr-6f27419975c3f5475b451f4f3b2728eaac9f632e.zip
bgpd: display the IGP metric of the ultimate path in snmp
Display the IGP metric of the ultimate path in the SNMP OID mplsL3VpnVrfRteInetCidrMetric1. Fixes: da0c0ef70c ("bgpd: VRF-Lite fix best path selection") Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Diffstat (limited to '')
-rw-r--r--bgpd/bgp_mplsvpn_snmp.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/bgpd/bgp_mplsvpn_snmp.c b/bgpd/bgp_mplsvpn_snmp.c
index 7a2f618ce..8d5daa49c 100644
--- a/bgpd/bgp_mplsvpn_snmp.c
+++ b/bgpd/bgp_mplsvpn_snmp.c
@@ -1529,7 +1529,7 @@ static uint8_t *mplsL3vpnRteTable(struct variable *v, oid name[],
char vrf_name[VRF_NAMSIZ];
struct bgp *l3vpn_bgp;
struct bgp_dest *dest;
- struct bgp_path_info *pi;
+ struct bgp_path_info *pi, *bpi_ultimate;
const struct prefix *p;
uint16_t policy = 0;
@@ -1545,6 +1545,8 @@ static uint8_t *mplsL3vpnRteTable(struct variable *v, oid name[],
if (!pi)
return NULL;
+ bpi_ultimate = bgp_get_imported_bpi_ultimate(pi);
+
p = bgp_dest_get_prefix(dest);
if (!p)
@@ -1661,8 +1663,8 @@ static uint8_t *mplsL3vpnRteTable(struct variable *v, oid name[],
case MPLSL3VPNVRFRTEINETCIDRNEXTHOPAS:
return SNMP_INTEGER(pi->peer ? pi->peer->as : 0);
case MPLSL3VPNVRFRTEINETCIDRMETRIC1:
- if (pi->extra)
- return SNMP_INTEGER(pi->extra->igpmetric);
+ if (bpi_ultimate->extra)
+ return SNMP_INTEGER(bpi_ultimate->extra->igpmetric);
else
return SNMP_INTEGER(0);
case MPLSL3VPNVRFRTEINETCIDRMETRIC2: