Use igpmetric from bgp_path_info in bgp_igp_metric_total() to be
consistent with all other cases, e.g., as in bgp_path_info_cmp().
Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
(cherry picked from commit
b89e66a3bcd5644278f34ec5899b071066e102a1)
{
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 struct cluster_list *bgp_attr_get_cluster(const struct attr *attr)