diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-05 09:56:23 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-05 09:56:23 +0000 |
commit | c15d6efd40655f717841d00839a43df1ead5cb26 (patch) | |
tree | 35d579f9a19170e2b39085669ca92533c2d161b4 /zebra/zapi_msg.c | |
parent | Adding upstream version 10.0.1. (diff) | |
download | frr-c15d6efd40655f717841d00839a43df1ead5cb26.tar.xz frr-c15d6efd40655f717841d00839a43df1ead5cb26.zip |
Adding upstream version 10.1.upstream/10.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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 76cabd1..d585ef9 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)); } } |