int af;
int status;
uint32_t flags;
- union g_addr nexthop;
+ union g_addr dest;
mpls_label_t local_label;
mpls_label_t remote_label;
+ /* Nexthops */
+ struct nexthop_group nhg;
+
union pw_protocol_fields fields;
};
case DPLANE_OP_PW_INSTALL:
case DPLANE_OP_PW_UNINSTALL:
+ /* Free allocated nexthops */
+ if ((*pctx)->u.pw.nhg.nexthop) {
+ /* This deals with recursive nexthops too */
+ nexthops_free((*pctx)->u.pw.nhg.nexthop);
+
+ (*pctx)->u.pw.nhg.nexthop = NULL;
+ }
+ break;
+
case DPLANE_OP_NONE:
break;
}
return ctx->u.pw.status;
}
-const union g_addr *dplane_ctx_get_pw_nexthop(
+const union g_addr *dplane_ctx_get_pw_dest(
const struct zebra_dplane_ctx *ctx)
{
DPLANE_CTX_VALID(ctx);
- return &(ctx->u.pw.nexthop);
+ return &(ctx->u.pw.dest);
}
const union pw_protocol_fields *dplane_ctx_get_pw_proto(
/* This name appears to be c-string, so we use string copy. */
strlcpy(ctx->u.pw.ifname, pw->ifname, sizeof(ctx->u.pw.ifname));
+
ctx->zd_vrf_id = pw->vrf_id;
ctx->u.pw.ifindex = pw->ifindex;
ctx->u.pw.type = pw->type;
ctx->u.pw.remote_label = pw->remote_label;
ctx->u.pw.flags = pw->flags;
- ctx->u.pw.nexthop = pw->nexthop;
+ ctx->u.pw.dest = pw->nexthop;
ctx->u.pw.fields = pw->data;
int dplane_ctx_get_pw_af(const struct zebra_dplane_ctx *ctx);
uint32_t dplane_ctx_get_pw_flags(const struct zebra_dplane_ctx *ctx);
int dplane_ctx_get_pw_status(const struct zebra_dplane_ctx *ctx);
-const union g_addr *dplane_ctx_get_pw_nexthop(
+const union g_addr *dplane_ctx_get_pw_dest(
const struct zebra_dplane_ctx *ctx);
const union pw_protocol_fields *dplane_ctx_get_pw_proto(
const struct zebra_dplane_ctx *ctx);
/* pseudowire nexthop */
memset(&ss, 0, sizeof(ss));
- gaddr = dplane_ctx_get_pw_nexthop(ctx);
+ gaddr = dplane_ctx_get_pw_dest(ctx);
switch (dplane_ctx_get_pw_af(ctx)) {
case AF_INET:
sa_in->sin_family = AF_INET;