forked from Mirror/frr
Merge pull request #17813 from enkechen-panw/aigp-fix6
bgpd: use igpmetric in bgp_aigp_metric_total()
This commit is contained in:
commit
b4d640fc38
|
@ -604,10 +604,11 @@ static inline uint64_t bgp_aigp_metric_total(struct bgp_path_info *bpi)
|
|||
{
|
||||
uint64_t aigp = bgp_attr_get_aigp_metric(bpi->attr);
|
||||
|
||||
if (bpi->nexthop)
|
||||
return aigp + bpi->nexthop->metric;
|
||||
else
|
||||
/* Don't increment if it's locally sourced */
|
||||
if (bpi->peer == bpi->peer->bgp->peer_self)
|
||||
return aigp;
|
||||
|
||||
return bpi->extra ? (aigp + bpi->extra->igpmetric) : aigp;
|
||||
}
|
||||
|
||||
static inline void bgp_attr_set_med(struct attr *attr, uint32_t med)
|
||||
|
|
Loading…
Reference in a new issue