From 60ca3cc27d6d61e7a5a7921d00ed76ca42d44bd7 Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Tue, 9 Jul 2019 11:09:19 +0200 Subject: [PATCH] zebra: entries can be pushed in tables, under vrf netns backend initially, vrf backend if vrf-lite, and a specific table identifier is associated to a vrf. here, with netns vrf backend, there is no specific table assigned to except default routing table. use the passed table_id parameter in zapi api, and apply it to the entry to be pushed in, or to be removed. Signed-off-by: Philippe Guibert --- zebra/zapi_msg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c index ffdc4dc512..b0488b7559 100644 --- a/zebra/zapi_msg.c +++ b/zebra/zapi_msg.c @@ -1425,7 +1425,7 @@ static void zread_route_add(ZAPI_HANDLER_ARGS) re->flags = api.flags; re->uptime = monotime(NULL); re->vrf_id = vrf_id; - if (api.tableid && vrf_id == VRF_DEFAULT) + if (api.tableid) re->table = api.tableid; else re->table = zvrf->table_id; @@ -1624,7 +1624,7 @@ static void zread_route_del(ZAPI_HANDLER_ARGS) if (CHECK_FLAG(api.message, ZAPI_MESSAGE_SRCPFX)) src_p = &api.src_prefix; - if (api.vrf_id == VRF_DEFAULT && api.tableid != 0) + if (api.tableid) table_id = api.tableid; else table_id = zvrf->table_id;