summaryrefslogtreecommitdiff
path: root/staticd/static_zebra.c
diff options
context:
space:
mode:
Diffstat (limited to 'staticd/static_zebra.c')
-rw-r--r--staticd/static_zebra.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/staticd/static_zebra.c b/staticd/static_zebra.c
index a62225294a..b75e1a1cdf 100644
--- a/staticd/static_zebra.c
+++ b/staticd/static_zebra.c
@@ -414,6 +414,10 @@ extern void static_zebra_route_add(struct static_path *pn, bool install)
api.tableid = pn->table_id;
}
frr_each(static_nexthop_list, &pn->nexthop_list, nh) {
+ /* Don't overrun the nexthop array */
+ if (nh_num == zebra_ecmp_count)
+ break;
+
api_nh = &api.nexthops[nh_num];
if (nh->nh_vrf_id == VRF_UNKNOWN)
continue;