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 <sworley@cumulusnetworks.com>
This commit is contained in:
Stephen Worley 2019-03-06 13:35:31 -05:00
parent e8968ccb2b
commit 1909e63acf

View File

@ -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: