mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-13 12:37:10 +00:00
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>
This commit is contained in:
parent
f0cde006f0
commit
6f27419975
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user