Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
/* 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;
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 */
* 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;
}