summaryrefslogtreecommitdiff
path: root/zebra/zebra_router.c
diff options
context:
space:
mode:
authorTuetuopay <tuetuopay@me.com>2019-03-28 18:41:38 +0100
committerGitHub <noreply@github.com>2019-03-28 18:41:38 +0100
commitd074383c621d904847d6c1cdf1e4d8825caf14ba (patch)
treeb0449b0bc79226875a2c2d4586ccbdd102ddaca4 /zebra/zebra_router.c
parent0fb2ad05d9e11a211915208e3fa648c8e170e31e (diff)
parent8db37bf14a28ccf89d891fe094d72c65b389dfd3 (diff)
Merge branch 'master' into evpn-session-vrf
Diffstat (limited to 'zebra/zebra_router.c')
-rw-r--r--zebra/zebra_router.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/zebra/zebra_router.c b/zebra/zebra_router.c
index c3b861c242..9e09cbca3f 100644
--- a/zebra/zebra_router.c
+++ b/zebra/zebra_router.c
@@ -164,14 +164,33 @@ static void zebra_router_free_table(struct zebra_router_table *zrt)
{
void *table_info;
- rib_close_table(zrt->table);
-
table_info = route_table_get_info(zrt->table);
route_table_finish(zrt->table);
+ RB_REMOVE(zebra_router_table_head, &zrouter.tables, zrt);
+
XFREE(MTYPE_RIB_TABLE_INFO, table_info);
XFREE(MTYPE_ZEBRA_NS, zrt);
}
+void zebra_router_release_table(struct zebra_vrf *zvrf, uint32_t tableid,
+ afi_t afi, safi_t safi)
+{
+ struct zebra_router_table finder;
+ struct zebra_router_table *zrt;
+
+ memset(&finder, 0, sizeof(finder));
+ finder.afi = afi;
+ finder.safi = safi;
+ finder.tableid = tableid;
+ finder.ns_id = zvrf->zns->ns_id;
+ zrt = RB_FIND(zebra_router_table_head, &zrouter.tables, &finder);
+
+ if (!zrt)
+ return;
+
+ zebra_router_free_table(zrt);
+}
+
uint32_t zebra_router_get_next_sequence(void)
{
return 1