diff options
| author | Mark Stapp <mstapp@nvidia.com> | 2022-02-17 09:49:41 -0500 |
|---|---|---|
| committer | Mark Stapp <mstapp@nvidia.com> | 2022-02-17 09:56:40 -0500 |
| commit | 1f7ab1a2cc2a7079c9dd2cb791fc6ba3b9c5a6aa (patch) | |
| tree | d3c70b3f028898d934faf1e1ca82e7d6400aa37e /staticd/static_zebra.c | |
| parent | abc246e19345cbd2bc74c7dc50dac0b9cf2addf8 (diff) | |
staticd: reject route config with too many nexthops
Restrict the number of nexthops for a route to the compiled-in
limit. Be careful with the zapi route struct's array of nexthops
too.
Signed-off-by: Mark Stapp <mstapp@nvidia.com>
Diffstat (limited to 'staticd/static_zebra.c')
| -rw-r--r-- | staticd/static_zebra.c | 4 |
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; |
