summaryrefslogtreecommitdiff
path: root/zebra/zebra_router.c
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2019-03-08 14:48:19 -0500
committerGitHub <noreply@github.com>2019-03-08 14:48:19 -0500
commit9af85338e13be4d9be2b7d5b0c976248a970843d (patch)
tree6d889bf8283bb74df0c07840358d91e5a27dd429 /zebra/zebra_router.c
parentf74ff6e32a3059b1c4960af7d1ddd0307a8bacb3 (diff)
parentbd4fb6158ddafa10b86a3a382934ed7a8c6e7afc (diff)
Merge pull request #3889 from donaldsharp/rnh_vrf_down_stuff
zebra Rnh vrf down stuff
Diffstat (limited to 'zebra/zebra_router.c')
-rw-r--r--zebra/zebra_router.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/zebra/zebra_router.c b/zebra/zebra_router.c
index c3b861c242..cabc8be8dd 100644
--- a/zebra/zebra_router.c
+++ b/zebra/zebra_router.c
@@ -168,10 +168,31 @@ static void zebra_router_free_table(struct zebra_router_table *zrt)
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