diff options
| author | Donald Sharp <donaldsharp72@gmail.com> | 2025-01-10 13:35:45 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-10 13:35:45 -0500 |
| commit | 48221b1f0b57bacf46134bf04da568f85e374d5c (patch) | |
| tree | 2ddcc0bbc1880d2210125f9cabeb530bff095771 | |
| parent | 8752401ebdffbaafdf64b0c69bc9df6b73a819ac (diff) | |
| parent | 7d6ee74f8872f51d9e34adaeb76b2c18e579ef41 (diff) | |
Merge pull request #17835 from FRRouting/mergify/bp/stable/10.0/pr-17813
bgpd: use igpmetric in bgp_aigp_metric_total() (backport #17813)
| -rw-r--r-- | bgpd/bgp_attr.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bgpd/bgp_attr.h b/bgpd/bgp_attr.h index 2271a67c5f..ee24531191 100644 --- a/bgpd/bgp_attr.h +++ b/bgpd/bgp_attr.h @@ -603,10 +603,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) |
