Skip to content

Commit

Permalink
zebra: Allow dplane to pass larger number of nexthops down to dataplane
Browse files Browse the repository at this point in the history
Currently FRR is limiting the nexthop count to a uint8_t not a
uint16_t.  This leads to issues when the nexthop count is 256
which results in the count to overflow to 0 causing problems
in the code.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
  • Loading branch information
donaldsharp committed Oct 7, 2024
1 parent ded59bc commit f2d5f42
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions zebra/zebra_dplane.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ struct dplane_nexthop_info {

struct nexthop_group ng;
struct nh_grp nh_grp[MULTIPATH_NUM];
uint8_t nh_grp_count;
uint16_t nh_grp_count;
};

/*
Expand Down Expand Up @@ -2316,7 +2316,7 @@ dplane_ctx_get_nhe_nh_grp(const struct zebra_dplane_ctx *ctx)
return ctx->u.rinfo.nhe.nh_grp;
}

uint8_t dplane_ctx_get_nhe_nh_grp_count(const struct zebra_dplane_ctx *ctx)
uint16_t dplane_ctx_get_nhe_nh_grp_count(const struct zebra_dplane_ctx *ctx)
{
DPLANE_CTX_VALID(ctx);
return ctx->u.rinfo.nhe.nh_grp_count;
Expand Down
2 changes: 1 addition & 1 deletion zebra/zebra_dplane.h
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ const struct nexthop_group *
dplane_ctx_get_nhe_ng(const struct zebra_dplane_ctx *ctx);
const struct nh_grp *
dplane_ctx_get_nhe_nh_grp(const struct zebra_dplane_ctx *ctx);
uint8_t dplane_ctx_get_nhe_nh_grp_count(const struct zebra_dplane_ctx *ctx);
uint16_t dplane_ctx_get_nhe_nh_grp_count(const struct zebra_dplane_ctx *ctx);

/* Accessors for LSP information */

Expand Down

0 comments on commit f2d5f42

Please sign in to comment.