From d53e72e5942291eb8c1b81ae6dcb320ef6194ec6 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sat, 14 Nov 2020 17:58:40 -0500 Subject: [PATCH] isisd: Free created tables On redistribution into isis we were creating a table for handling the redistributed routes, but never cleaning them up on shutdown properly. Do so. Signed-off-by: Donald Sharp --- isisd/isis_redist.c | 13 +++++++++++++ isisd/isis_redist.h | 1 + isisd/isisd.c | 1 + 3 files changed, 15 insertions(+) diff --git a/isisd/isis_redist.c b/isisd/isis_redist.c index e6c7a734bd..5714fa872a 100644 --- a/isisd/isis_redist.c +++ b/isisd/isis_redist.c @@ -380,6 +380,19 @@ static void isis_redist_update_zebra_subscriptions(struct isis *isis) } } +void isis_redist_free(struct isis *isis) +{ + int i; + + for (i = 0; i < REDIST_PROTOCOL_COUNT; i++) { + if (!isis->ext_info[i]) + continue; + + route_table_finish(isis->ext_info[i]); + isis->ext_info[i] = NULL; + } +} + void isis_redist_set(struct isis_area *area, int level, int family, int type, uint32_t metric, const char *routemap, int originate_type) { diff --git a/isisd/isis_redist.h b/isisd/isis_redist.h index 0d2dc6a803..afce922240 100644 --- a/isisd/isis_redist.h +++ b/isisd/isis_redist.h @@ -62,4 +62,5 @@ void isis_redist_set(struct isis_area *area, int level, int family, int type, uint32_t metric, const char *routemap, int originate_type); void isis_redist_unset(struct isis_area *area, int level, int family, int type); +void isis_redist_free(struct isis *isis); #endif diff --git a/isisd/isisd.c b/isisd/isisd.c index 668b60e385..950cdc281f 100644 --- a/isisd/isisd.c +++ b/isisd/isisd.c @@ -587,6 +587,7 @@ void isis_finish(struct isis *isis) isis_vrf_unlink(isis, vrf); } + isis_redist_free(isis); list_delete(&isis->area_list); list_delete(&isis->init_circ_list); XFREE(MTYPE_ISIS, isis); -- 2.39.5