summaryrefslogtreecommitdiffstats
path: root/lib/routemap.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-08-03 14:18:11 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-08-03 14:22:45 +0200
commit8619629ada22ed19eb95d491799cc03a13d6d8aa (patch)
tree856dd0a838a555b2a909dfe939f91d8852df805c /lib/routemap.c
parentpimd: On shutdown ensure wheel exists (diff)
downloadfrr-8619629ada22ed19eb95d491799cc03a13d6d8aa.tar.xz
frr-8619629ada22ed19eb95d491799cc03a13d6d8aa.zip
lib, bgpd, ospf6d, ospfd, pimd: Allow finish to cleanup a bit more
When calling route_map_finish, every place that we do we must first set the deletion event to NULL, or we will create an infinite loop, if we are using the delayed route-map application code. As such we might as well just make the route_map_finish code do this work, as that there is really no viable alternative here and route_map_finish should only be called on shutdown. This fixes an infinite loop in zebra on shutdown when there are route-maps. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'lib/routemap.c')
-rw-r--r--lib/routemap.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/routemap.c b/lib/routemap.c
index 6c4585365..4e8682f31 100644
--- a/lib/routemap.c
+++ b/lib/routemap.c
@@ -2741,6 +2741,15 @@ void route_map_finish(void)
vector_free(route_set_vec);
route_set_vec = NULL;
+ /*
+ * All protocols are setting these to NULL
+ * by default on shutdown( route_map_finish )
+ * Why are we making them do this work?
+ */
+ route_map_master.add_hook = NULL;
+ route_map_master.delete_hook = NULL;
+ route_map_master.event_hook = NULL;
+
/* cleanup route_map */
while (route_map_master.head) {
struct route_map *map = route_map_master.head;