diff options
| author | Stephen Worley <sworley@cumulusnetworks.com> | 2019-07-25 13:27:59 -0400 |
|---|---|---|
| committer | Stephen Worley <sworley@cumulusnetworks.com> | 2019-10-25 11:13:41 -0400 |
| commit | 8dbc800f42797105b53fd385eb57ac30bc372d7d (patch) | |
| tree | 8702bb8ef891fd054b4551f10211ecf933a0a5ab /zebra/zebra_dplane.c | |
| parent | 4b87c90d58a04650d8bc4316115c3233236431a0 (diff) | |
zebra: Prevent duplication and overflow in nhe2grp
The kernel does not allow duplicate IDs in the same group, but
we are perfectly find with it internally if two different
nexthops resolve the the same nexthop (default route for instance).
So, we have to handle this when we get ready to install.
Further, pass the max group size in the arguments to ensure we
don't overflow. Don't actually think this is possible due to
multipath checking in nexthop_active_update() but better to be
safe.
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_dplane.c')
| -rw-r--r-- | zebra/zebra_dplane.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c index 2346cb7f0d..e4002252d3 100644 --- a/zebra/zebra_dplane.c +++ b/zebra/zebra_dplane.c @@ -1589,8 +1589,8 @@ static int dplane_ctx_nexthop_init(struct zebra_dplane_ctx *ctx, /* If its a group, convert it to a grp array of ids */ if (!zebra_nhg_depends_is_empty(nhe) && !CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_RECURSIVE)) - ctx->u.rinfo.nhe.nh_grp_count = - zebra_nhg_nhe2grp(ctx->u.rinfo.nhe.nh_grp, nhe); + ctx->u.rinfo.nhe.nh_grp_count = zebra_nhg_nhe2grp( + ctx->u.rinfo.nhe.nh_grp, nhe, MULTIPATH_NUM); zns = ((struct zebra_vrf *)vrf_info_lookup(nhe->vrf_id))->zns; |
