diff options
| author | Mark Stapp <mjs@voltanet.io> | 2020-03-17 14:47:58 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-17 14:47:58 -0400 |
| commit | 7bffea9dff1cf23b92ff2343a1e241d718d1d5cf (patch) | |
| tree | eaf9eb64bd77c7d22bad7f949c46ac8b8b867a34 | |
| parent | 7967afda0799711bf4ce3bfe8b8b51ceb179376e (diff) | |
| parent | a2665e381ce0929d8194f840bb8a255ee52f3f9b (diff) | |
Merge pull request #6006 from sarav511/zbr_crsh
zebra: Disable rmap update thread before routemap_finish while shutting down Zebra
| -rw-r--r-- | zebra/main.c | 9 | ||||
| -rw-r--r-- | zebra/zebra_routemap.c | 9 | ||||
| -rw-r--r-- | zebra/zebra_routemap.h | 1 |
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 |
