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 <philippe.guibert@6wind.com>
This commit is contained in:
Philippe Guibert 2019-07-09 11:09:19 +02:00
parent 1276ce3833
commit 60ca3cc27d

View File

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