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);
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(
enum nexthop_types_t nh_type,
union g_addr *gate,
ifindex_t ifindex,
- mpls_label_t out_label)
+ uint8_t num_labels,
+ mpls_label_t out_labels[])
{
zebra_nhlfe_t *nhlfe;
nhlfe = zebra_mpls_lsp_add_nhlfe(&(ctx->u.lsp),
lsp_type, nh_type, gate,
- ifindex, out_label);
+ ifindex, num_labels, out_labels);
return nhlfe;
}
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))
nhlfe->nexthop->type,
&(nhlfe->nexthop->gate),
nhlfe->nexthop->ifindex,
- nhlfe->nexthop->nh_label->label[0]);
+ nhlfe->nexthop->nh_label->num_labels,
+ nhlfe->nexthop->nh_label->label);
if (new_nhlfe == NULL || new_nhlfe->nexthop == NULL) {
ret = ENOMEM;
if (re)
copy_nexthops(&(ctx->u.pw.nhg.nexthop),
- re->ng->nexthop, NULL);
+ re->nhe->nhg->nexthop, NULL);
route_unlock_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 */
}
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;
}
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;