From 03951374770da5be620e48768588928fbd809c83 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Sun, 6 Aug 2017 08:28:16 +0200 Subject: *: centralize some exit cleanup into libfrr Start creating a counterpart to frr_init and frr_late_init. Unfortunately, some daemons don't do any exit handling, this doesn't change that just yet. Signed-off-by: David Lamparter --- bgpd/bgp_main.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'bgpd/bgp_main.c') diff --git a/bgpd/bgp_main.c b/bgpd/bgp_main.c index 25a562ed6..a80dff271 100644 --- a/bgpd/bgp_main.c +++ b/bgpd/bgp_main.c @@ -172,6 +172,8 @@ static __attribute__((__noreturn__)) void bgp_exit(int status) /* it only makes sense for this to be called on a clean exit */ assert(status == 0); + frr_early_fini(); + bfd_gbl_exit(); bgp_close(); @@ -214,22 +216,16 @@ static __attribute__((__noreturn__)) void bgp_exit(int status) community_list_terminate(bgp_clist); bgp_vrf_terminate(); - cmd_terminate(); - vty_terminate(); #if ENABLE_BGP_VNC vnc_zebra_destroy(); #endif bgp_zebra_destroy(); - /* reverse bgp_master_init */ - if (bm->master) - thread_master_free(bm->master); - - closezlog(); - list_delete(bm->bgp); memset(bm, 0, sizeof(*bm)); + frr_fini(); + if (bgp_debug_count()) log_memstats_stderr("bgpd"); exit(status); -- cgit v1.2.3