summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--zebra/main.c9
-rw-r--r--zebra/zebra_routemap.c9
-rw-r--r--zebra/zebra_routemap.h1
3 files changed, 18 insertions, 1 deletions
diff --git a/zebra/main.c b/zebra/main.c
index 5951c7e280..dab1449194 100644
--- a/zebra/main.c
+++ b/zebra/main.c
@@ -53,6 +53,7 @@
#include "zebra/zebra_rnh.h"
#include "zebra/zebra_pbr.h"
#include "zebra/zebra_vxlan.h"
+#include "zebra/zebra_routemap.h"
#if defined(HANDLE_NETLINK_FUZZING)
#include "zebra/kernel_netlink.h"
@@ -179,7 +180,13 @@ static void sigint(void)
access_list_reset();
prefix_list_reset();
- route_map_finish();
+ /*
+ * zebra_routemap_finish will
+ * 1 set rmap upd timer to 0 so that rmap update wont be scheduled again
+ * 2 Put off the rmap update thread
+ * 3 route_map_finish
+ */
+ zebra_routemap_finish();
list_delete(&zrouter.client_list);
diff --git a/zebra/zebra_routemap.c b/zebra/zebra_routemap.c
index 2963d83828..500c2c84a1 100644
--- a/zebra/zebra_routemap.c
+++ b/zebra/zebra_routemap.c
@@ -1793,6 +1793,15 @@ static void zebra_route_map_set_delay_timer(uint32_t value)
}
}
+void zebra_routemap_finish(void)
+{
+ /* Set zebra_rmap_update_timer to 0 so that it wont schedule again */
+ zebra_rmap_update_timer = 0;
+ /* Thread off if any scheduled already */
+ THREAD_TIMER_OFF(zebra_t_rmap_update);
+ route_map_finish();
+}
+
void zebra_route_map_write_delay_timer(struct vty *vty)
{
if (vty && (zebra_rmap_update_timer != ZEBRA_RMAP_DEFAULT_UPDATE_TIMER))
diff --git a/zebra/zebra_routemap.h b/zebra/zebra_routemap.h
index 6a630e1ac0..56e805ea03 100644
--- a/zebra/zebra_routemap.h
+++ b/zebra/zebra_routemap.h
@@ -56,4 +56,5 @@ zebra_nht_route_map_check(afi_t afi, int client_proto, const struct prefix *p,
}
#endif
+extern void zebra_routemap_finish(void);
#endif