bgpd: Respect bgp bestpath missing-as-worst for table-map as well

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
This commit is contained in:
Donatas Abraitis 2024-12-26 17:26:42 +02:00
parent 803ff41cc4
commit fa8663141e
3 changed files with 3 additions and 2 deletions

View File

@ -649,7 +649,7 @@ static bool use_bgp_med_value(struct attr *attr, struct bgp *bgp)
/* Get MED value. If MED value is missing and "bgp bestpath
missing-as-worst" is specified, treat it as the worst value. */
static uint32_t bgp_med_value(struct attr *attr, struct bgp *bgp)
uint32_t bgp_med_value(struct attr *attr, struct bgp *bgp)
{
if (CHECK_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_MULTI_EXIT_DISC)))
return attr->med;

View File

@ -1012,4 +1012,5 @@ extern void bgp_meta_queue_free(struct meta_queue *mq);
extern int early_route_process(struct bgp *bgp, struct bgp_dest *dest);
extern int other_route_process(struct bgp *bgp, struct bgp_dest *dest);
extern int eoiu_marker_process(struct bgp *bgp, struct bgp_dest *dest);
extern uint32_t bgp_med_value(struct attr *attr, struct bgp *bgp);
#endif /* _QUAGGA_BGP_ROUTE_H */

View File

@ -1339,7 +1339,7 @@ static void bgp_zebra_announce_parse_nexthop(
* overridden on 1st nexthop */
if (mpinfo == info) {
if (metric)
*metric = mpinfo_cp->attr->med;
*metric = bgp_med_value(mpinfo_cp->attr, bgp);
if (tag)
*tag = mpinfo_cp->attr->tag;
}