diff options
| author | Stephen Worley <sworley@cumulusnetworks.com> | 2019-08-01 14:07:04 -0400 |
|---|---|---|
| committer | Stephen Worley <sworley@cumulusnetworks.com> | 2019-10-25 11:13:41 -0400 |
| commit | 38e40db1c9695786d41a85661e313ce5a207866f (patch) | |
| tree | 16e6399ae8cdc01a20bff437db782689ad94b786 /zebra/zebra_dplane.c | |
| parent | 428b4c0a5d798d3a0c1984da7d02e0df86df978e (diff) | |
zebra: Sweep our nexthop objects out on restart
On restart, if we failed to remove any nexthop objects due
to a kill -9 or such event, sweep them if we aren't using them.
Add a proto field to handle this and remove the is_kernel bool.
Add a dupicate flag that indicates this nexthop group is only
present in our ID hashtable. It is a dupicate nexthop we received
from the kernel, therefore we cannot hash on it.
Make the idcounter globally accessible so that kernel updates
increment it as soon as we receive them, not when we handle them.
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_dplane.c')
| -rw-r--r-- | zebra/zebra_dplane.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c index 0e89ba3a27..e2c7bd7635 100644 --- a/zebra/zebra_dplane.c +++ b/zebra/zebra_dplane.c @@ -73,7 +73,7 @@ struct dplane_nexthop_info { uint32_t id; afi_t afi; vrf_id_t vrf_id; - bool is_kernel_nh; + int type; struct nexthop_group ng; struct nh_grp nh_grp[MULTIPATH_NUM]; @@ -1077,10 +1077,10 @@ vrf_id_t dplane_ctx_get_nhe_vrf_id(const struct zebra_dplane_ctx *ctx) return ctx->u.rinfo.nhe.vrf_id; } -bool dplane_ctx_get_nhe_is_kernel_nh(const struct zebra_dplane_ctx *ctx) +int dplane_ctx_get_nhe_type(const struct zebra_dplane_ctx *ctx) { DPLANE_CTX_VALID(ctx); - return ctx->u.rinfo.nhe.is_kernel_nh; + return ctx->u.rinfo.nhe.type; } const struct nexthop_group * @@ -1577,13 +1577,12 @@ static int dplane_ctx_nexthop_init(struct zebra_dplane_ctx *ctx, ctx->zd_op = op; ctx->zd_status = ZEBRA_DPLANE_REQUEST_SUCCESS; - ctx->u.rinfo.zd_type = ZEBRA_ROUTE_TABLE; /* Copy over nhe info */ ctx->u.rinfo.nhe.id = nhe->id; ctx->u.rinfo.nhe.afi = nhe->afi; ctx->u.rinfo.nhe.vrf_id = nhe->vrf_id; - ctx->u.rinfo.nhe.is_kernel_nh = nhe->is_kernel_nh; + ctx->u.rinfo.nhe.type = nhe->type; nexthop_group_copy(&(ctx->u.rinfo.nhe.ng), nhe->nhg); |
