summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_main.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2017-08-06 08:28:16 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2017-08-15 13:25:44 +0200
commit03951374770da5be620e48768588928fbd809c83 (patch)
treee2234dd2ace2aa632646729dc5956901426d7f19 /bgpd/bgp_main.c
parentlib: hooks: support priority ordering & reversing (diff)
downloadfrr-03951374770da5be620e48768588928fbd809c83.tar.xz
frr-03951374770da5be620e48768588928fbd809c83.zip
*: 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 <equinox@opensourcerouting.org>
Diffstat (limited to 'bgpd/bgp_main.c')
-rw-r--r--bgpd/bgp_main.c12
1 files changed, 4 insertions, 8 deletions
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);