diff options
Diffstat (limited to 'zebra/zebra_dplane.c')
| -rw-r--r-- | zebra/zebra_dplane.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c index aecadfadf8..bf1ba522a3 100644 --- a/zebra/zebra_dplane.c +++ b/zebra/zebra_dplane.c @@ -1023,6 +1023,11 @@ uint8_t dplane_ctx_get_old_distance(const struct zebra_dplane_ctx *ctx) return ctx->u.rinfo.zd_old_distance; } +/* + * Set the nexthops associated with a context: note that processing code + * may well expect that nexthops are in canonical (sorted) order, so we + * will enforce that here. + */ void dplane_ctx_set_nexthops(struct zebra_dplane_ctx *ctx, struct nexthop *nh) { DPLANE_CTX_VALID(ctx); @@ -1031,7 +1036,7 @@ void dplane_ctx_set_nexthops(struct zebra_dplane_ctx *ctx, struct nexthop *nh) nexthops_free(ctx->u.rinfo.zd_ng.nexthop); ctx->u.rinfo.zd_ng.nexthop = NULL; } - copy_nexthops(&(ctx->u.rinfo.zd_ng.nexthop), nh, NULL); + nexthop_group_copy_nh_sorted(&(ctx->u.rinfo.zd_ng), nh); } const struct nexthop_group *dplane_ctx_get_ng( @@ -1508,7 +1513,8 @@ static int dplane_ctx_route_init(struct zebra_dplane_ctx *ctx, ctx->u.rinfo.zd_safi = info->safi; /* Copy nexthops; recursive info is included too */ - copy_nexthops(&(ctx->u.rinfo.zd_ng.nexthop), re->ng->nexthop, NULL); + copy_nexthops(&(ctx->u.rinfo.zd_ng.nexthop), + re->nhe->nhg->nexthop, NULL); /* Ensure that the dplane's nexthops flags are clear. */ for (ALL_NEXTHOPS(ctx->u.rinfo.zd_ng, nexthop)) @@ -1748,7 +1754,7 @@ static int dplane_ctx_pw_init(struct zebra_dplane_ctx *ctx, if (re) copy_nexthops(&(ctx->u.pw.nhg.nexthop), - re->ng->nexthop, NULL); + re->nhe->nhg->nexthop, NULL); route_unlock_node(rn); } @@ -1844,7 +1850,7 @@ dplane_route_update_internal(struct route_node *rn, * We'll need these to do per-nexthop deletes. */ copy_nexthops(&(ctx->u.rinfo.zd_old_ng.nexthop), - old_re->ng->nexthop, NULL); + old_re->nhe->nhg->nexthop, NULL); #endif /* !HAVE_NETLINK */ } @@ -2507,7 +2513,7 @@ enum zebra_dplane_result dplane_neigh_add(const struct interface *ifp, enum zebra_dplane_result result = ZEBRA_DPLANE_REQUEST_FAILURE; result = neigh_update_internal(DPLANE_OP_NEIGH_INSTALL, - ifp, mac, ip, flags, 0); + ifp, mac, ip, flags, DPLANE_NUD_NOARP); return result; } @@ -2813,6 +2819,7 @@ int dplane_provider_register(const char *name, TAILQ_INIT(&(p->dp_ctx_in_q)); TAILQ_INIT(&(p->dp_ctx_out_q)); + p->dp_flags = flags; p->dp_priority = prio; p->dp_fp = fp; p->dp_start = start_fp; |
