Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bgpd: use igpmetric in bgp_aigp_metric_total() (backport #17813) #17834

Merged
merged 1 commit into from
Jan 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions bgpd/bgp_attr.h
Original file line number Diff line number Diff line change
Expand Up @@ -602,10 +602,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 struct cluster_list *bgp_attr_get_cluster(const struct attr *attr)
Expand Down
Loading