bgpd: Return MED, not local-preference if MED attribute exists (SNMP)

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
This commit is contained in:
Donatas Abraitis 2022-12-15 23:46:49 +02:00
parent 71a055c9d1
commit 15c3b52f3f

View File

@ -739,7 +739,7 @@ static uint8_t *bgp4v2PathAttrTable(struct variable *v, oid name[],
case BGP4V2_NLRI_MED: case BGP4V2_NLRI_MED:
if (CHECK_FLAG(path->attr->flag, if (CHECK_FLAG(path->attr->flag,
ATTR_FLAG_BIT(BGP_ATTR_MULTI_EXIT_DISC))) ATTR_FLAG_BIT(BGP_ATTR_MULTI_EXIT_DISC)))
return SNMP_INTEGER(path->attr->local_pref); return SNMP_INTEGER(path->attr->med);
else else
return SNMP_INTEGER(0); return SNMP_INTEGER(0);
case BGP4V2_NLRI_ATOMIC_AGGREGATE: case BGP4V2_NLRI_ATOMIC_AGGREGATE: