diff options
| author | Russ White <russ@riw.us> | 2024-04-26 14:41:05 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-26 14:41:05 -0400 |
| commit | f19817f71daeb3b566ac55e5605c683dfcd70369 (patch) | |
| tree | c530c5282562c3a65a3e8a4a4b9ff0e5f7474382 /zebra/zapi_msg.c | |
| parent | 6a7fadaecc5367dcf05694da5dcfc226d5cfec09 (diff) | |
| parent | 634d1375faa62c6593cc9292d32804666333a1f6 (diff) | |
Merge pull request #15723 from opensourcerouting/feature/extended_link_bw_refactored_v1
bgpd: Implement extended link-bandwidth
Diffstat (limited to 'zebra/zapi_msg.c')
| -rw-r--r-- | zebra/zapi_msg.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c index 76cabd1bf0..d585ef996b 100644 --- a/zebra/zapi_msg.c +++ b/zebra/zapi_msg.c @@ -1724,7 +1724,7 @@ static bool zapi_read_nexthops(struct zserv *client, struct prefix *p, * Let's convert the weights to a scaled value * between 1 and zrouter.nexthop_weight_scale_value * This is a simple application of a ratio: - * scaled_weight/zrouter.nexthop_weight_scale_value = + * scaled_weight/zrouter.nexthop_weight_scale_value = * weight/max_weight * This translates to: * scaled_weight = weight * zrouter.nexthop_weight_scale_value @@ -1738,9 +1738,8 @@ static bool zapi_read_nexthops(struct zserv *client, struct prefix *p, for (i = 0; i < nexthop_num; i++) { znh = &nhops[i]; - tmp = (uint64_t)znh->weight * - zrouter.nexthop_weight_scale_value; - znh->weight = MAX(1, ((uint32_t)(tmp / max_weight))); + tmp = znh->weight * zrouter.nexthop_weight_scale_value; + znh->weight = MAX(1, (tmp / max_weight)); } } |
