bgp: Reorg cleanup to align process and bgp instance init/destroy
Signed-off-by: Lou Berger <lberger@labn.net>
diff --git a/bgpd/bgp_main.c b/bgpd/bgp_main.c
index 591a6f9..11c73ce 100644
--- a/bgpd/bgp_main.c
+++ b/bgpd/bgp_main.c
@@ -227,7 +227,6 @@
struct listnode *node, *nnode;
int *socket;
struct interface *ifp;
- extern struct zclient *zclient;
extern struct zclient *zlookup;
/* it only makes sense for this to be called on a clean exit */
@@ -314,8 +313,9 @@
vrf_terminate ();
cmd_terminate ();
vty_terminate ();
- if (zclient)
- zclient_free (zclient);
+ bgp_address_destroy();
+ bgp_scan_destroy();
+ bgp_zebra_destroy();
if (zlookup)
zclient_free (zlookup);
if (bgp_nexthop_buf)