summaryrefslogtreecommitdiffstats
path: root/sharpd
diff options
context:
space:
mode:
Diffstat (limited to 'sharpd')
-rw-r--r--sharpd/sharp_zebra.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sharpd/sharp_zebra.c b/sharpd/sharp_zebra.c
index 03def0d9b..edbc7460e 100644
--- a/sharpd/sharp_zebra.c
+++ b/sharpd/sharp_zebra.c
@@ -365,6 +365,13 @@ void nhg_add(uint32_t id, const struct nexthop_group *nhg)
struct nexthop *nh;
for (ALL_NEXTHOPS_PTR(nhg, nh)) {
+ if (nexthop_num >= MULTIPATH_NUM) {
+ zlog_warn(
+ "%s: number of nexthops greater than max multipath size, truncating",
+ __func__);
+ break;
+ }
+
api_nh = &nh_array[nexthop_num];
zapi_nexthop_from_nexthop(api_nh, nh);