From 15c3b52f3ffc75ad3f447b7091285722551f85f7 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Thu, 15 Dec 2022 23:46:49 +0200 Subject: [PATCH] bgpd: Return MED, not local-preference if MED attribute exists (SNMP) Signed-off-by: Donatas Abraitis --- bgpd/bgp_snmp_bgp4v2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bgpd/bgp_snmp_bgp4v2.c b/bgpd/bgp_snmp_bgp4v2.c index d74c13c9c5..7baa370b70 100644 --- a/bgpd/bgp_snmp_bgp4v2.c +++ b/bgpd/bgp_snmp_bgp4v2.c @@ -739,7 +739,7 @@ static uint8_t *bgp4v2PathAttrTable(struct variable *v, oid name[], case BGP4V2_NLRI_MED: if (CHECK_FLAG(path->attr->flag, ATTR_FLAG_BIT(BGP_ATTR_MULTI_EXIT_DISC))) - return SNMP_INTEGER(path->attr->local_pref); + return SNMP_INTEGER(path->attr->med); else return SNMP_INTEGER(0); case BGP4V2_NLRI_ATOMIC_AGGREGATE: -- 2.39.5