From 1909e63acf228bd7e25abaa235e91defa9cc0b63 Mon Sep 17 00:00:00 2001 From: Stephen Worley Date: Wed, 6 Mar 2019 13:35:31 -0500 Subject: [PATCH] zebra: Add namespace info to the nexthop dataplane ctx The nexthop dataplane context was not getting populated with namespace info for its netlink messages. Fixed this to do lookups the same way we do it with route contexts. Signed-off-by: Stephen Worley --- zebra/zebra_dplane.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c index d53defea11..f20242bfc2 100644 --- a/zebra/zebra_dplane.c +++ b/zebra/zebra_dplane.c @@ -1495,6 +1495,9 @@ static int dplane_ctx_nexthop_init(struct zebra_dplane_ctx *ctx, enum dplane_op_e op, struct nhg_hash_entry *nhe) { + struct zebra_ns *zns; + struct zebra_vrf *zvrf; + int ret = EINVAL; if (!ctx || !nhe) @@ -1508,6 +1511,14 @@ static int dplane_ctx_nexthop_init(struct zebra_dplane_ctx *ctx, ctx->u.rinfo.zd_nhe.nhg.nexthop = NULL; nexthop_group_copy(&(ctx->u.rinfo.zd_nhe.nhg), &nhe->nhg); + /* Extract ns info - can't use pointers to 'core' structs */ + zvrf = vrf_info_lookup(nhe->vrf_id); + zns = zvrf->zns; + + // TODO: Might not need to mark this as an update, since + // it probably won't require two messages + dplane_ctx_ns_init(ctx, zns, (op == DPLANE_OP_NH_UPDATE)); + ret = AOK; done: