summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/thread.c3
-rw-r--r--ospfd/ospf_main.c1
-rw-r--r--ospfd/ospfd.c5
-rw-r--r--pbrd/pbr_main.c2
-rw-r--r--sharpd/sharp_main.c2
-rw-r--r--staticd/static_main.c3
-rw-r--r--vrrpd/vrrp_main.c2
7 files changed, 15 insertions, 3 deletions
diff --git a/lib/thread.c b/lib/thread.c
index 4d689a9f88..9b2f5661ac 100644
--- a/lib/thread.c
+++ b/lib/thread.c
@@ -1094,7 +1094,8 @@ static void do_thread_cancel(struct thread_master *master)
}
/* Delete and free all cancellation requests */
- list_delete_all_node(master->cancel_req);
+ if (master->cancel_req)
+ list_delete_all_node(master->cancel_req);
/* Wake up any threads which may be blocked in thread_cancel_async() */
master->canceled = true;
diff --git a/ospfd/ospf_main.c b/ospfd/ospf_main.c
index e534e72a64..45382e48d3 100644
--- a/ospfd/ospf_main.c
+++ b/ospfd/ospf_main.c
@@ -98,6 +98,7 @@ static void sigint(void)
{
zlog_notice("Terminating on signal");
ospf_terminate();
+ exit(0);
}
/* SIGUSR1 handler. */
diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c
index e9f622d217..cdfcaa44d6 100644
--- a/ospfd/ospfd.c
+++ b/ospfd/ospfd.c
@@ -517,9 +517,9 @@ void ospf_terminate(void)
SET_FLAG(om->options, OSPF_MASTER_SHUTDOWN);
- /* exit immediately if OSPF not actually running */
+ /* Skip some steps if OSPF not actually running */
if (listcount(om->ospf) == 0)
- exit(0);
+ goto done;
bfd_gbl_exit();
for (ALL_LIST_ELEMENTS(om->ospf, node, nnode, ospf))
@@ -543,6 +543,7 @@ void ospf_terminate(void)
zclient_stop(zclient);
zclient_free(zclient);
+done:
frr_fini();
}
diff --git a/pbrd/pbr_main.c b/pbrd/pbr_main.c
index 57338738f6..9a9edd79c6 100644
--- a/pbrd/pbr_main.c
+++ b/pbrd/pbr_main.c
@@ -82,6 +82,8 @@ static void sigint(void)
{
zlog_notice("Terminating on signal");
+ frr_fini();
+
exit(0);
}
diff --git a/sharpd/sharp_main.c b/sharpd/sharp_main.c
index db65836388..40b41fd728 100644
--- a/sharpd/sharp_main.c
+++ b/sharpd/sharp_main.c
@@ -81,6 +81,8 @@ static void sigint(void)
{
zlog_notice("Terminating on signal");
+ frr_fini();
+
exit(0);
}
diff --git a/staticd/static_main.c b/staticd/static_main.c
index 08062f19d8..3c5922b85a 100644
--- a/staticd/static_main.c
+++ b/staticd/static_main.c
@@ -42,6 +42,7 @@ char backup_config_file[256];
bool mpls_enabled;
+
zebra_capabilities_t _caps_p[] = {
};
@@ -75,6 +76,8 @@ static void sigint(void)
static_vrf_terminate();
+ frr_fini();
+
exit(0);
}
diff --git a/vrrpd/vrrp_main.c b/vrrpd/vrrp_main.c
index d8c35dd2a3..ce274d4810 100644
--- a/vrrpd/vrrp_main.c
+++ b/vrrpd/vrrp_main.c
@@ -82,6 +82,8 @@ static void __attribute__((noreturn)) sigint(void)
vrrp_fini();
+ frr_fini();
+
exit(0);
}