summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--zebra/main.c4
-rw-r--r--zebra/zebra_router.c2
-rw-r--r--zebra/zebra_router.h1
3 files changed, 5 insertions, 2 deletions
diff --git a/zebra/main.c b/zebra/main.c
index 275d9af5d2..2a8dc39771 100644
--- a/zebra/main.c
+++ b/zebra/main.c
@@ -443,8 +443,8 @@ int main(int argc, char **argv)
* we have to have route_read() called before.
*/
zrouter.startup_time = monotime(NULL);
- thread_add_timer(zrouter.master, rib_sweep_route,
- NULL, graceful_restart, NULL);
+ thread_add_timer(zrouter.master, rib_sweep_route, NULL,
+ graceful_restart, &zrouter.sweeper);
/* Needed for BSD routing socket. */
pid = getpid();
diff --git a/zebra/zebra_router.c b/zebra/zebra_router.c
index a80c573855..92a3b9424b 100644
--- a/zebra/zebra_router.c
+++ b/zebra/zebra_router.c
@@ -232,6 +232,8 @@ void zebra_router_terminate(void)
{
struct zebra_router_table *zrt, *tmp;
+ THREAD_OFF(zrouter.sweeper);
+
RB_FOREACH_SAFE (zrt, zebra_router_table_head, &zrouter.tables, tmp)
zebra_router_free_table(zrt);
diff --git a/zebra/zebra_router.h b/zebra/zebra_router.h
index 408f9cbee5..dd788216c7 100644
--- a/zebra/zebra_router.h
+++ b/zebra/zebra_router.h
@@ -196,6 +196,7 @@ struct zebra_router {
* Time for when we sweep the rib from old routes
*/
time_t startup_time;
+ struct thread *sweeper;
/*
* The hash of nexthop groups associated with this router