summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--zebra/zapi_msg.c3
-rw-r--r--zebra/zebra_router.c2
-rw-r--r--zebra/zebra_router.h2
3 files changed, 6 insertions, 1 deletions
diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c
index 2aeb1b97e9..92a81f6828 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 4caaf8a9e2..5299716091 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 bd86cfb495..b700851df5 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