diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c index 2aeb1b97e925..92a81f682873 100644 --- a/zebra/zapi_msg.c +++ b/zebra/zapi_msg.c @@ -1730,7 +1730,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 * 255; + tmp = (uint64_t)znh->weight * + zrouter.nexthop_weight_scale_value; znh->weight = MAX(1, ((uint32_t)(tmp / max_weight))); } } diff --git a/zebra/zebra_router.c b/zebra/zebra_router.c index 4caaf8a9e27f..52997160918b 100644 --- a/zebra/zebra_router.c +++ b/zebra/zebra_router.c @@ -323,6 +323,8 @@ void zebra_router_init(bool asic_offload, bool notify_on_ack, #endif zrouter.asic_notification_nexthop_control = false; + zrouter.nexthop_weight_scale_value = 255; + #ifdef HAVE_SCRIPTING zebra_script_init(); #endif diff --git a/zebra/zebra_router.h b/zebra/zebra_router.h index bd86cfb49519..b700851df580 100644 --- a/zebra/zebra_router.h +++ b/zebra/zebra_router.h @@ -231,6 +231,8 @@ struct zebra_router { bool allow_delete; uint8_t protodown_r_bit; + + uint64_t nexthop_weight_scale_value; }; #define GRACEFUL_RESTART_TIME 60