From 2f35bbfe7453f5c7f6f81a3bea83be38232f75c5 Mon Sep 17 00:00:00 2001 From: Lou Berger Date: Tue, 12 Jan 2016 13:42:03 -0500 Subject: [PATCH] bgp: Reorg cleanup to align process and bgp instance init/destroy bgp_address_destroy became per-bgp instance. Moved the call to the bgp_address_destroy function to the bgp delete. Signed-off-by: Lou Berger (cherry picked from commit 637035710a2f8e1e5944ee714135b7f88ac15ac4) --- bgpd/bgp_main.c | 5 ++--- bgpd/bgpd.c | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bgpd/bgp_main.c b/bgpd/bgp_main.c index 0d24c9c294..20fa138ce8 100644 --- a/bgpd/bgp_main.c +++ b/bgpd/bgp_main.c @@ -227,7 +227,6 @@ bgp_exit (int status) { struct bgp *bgp; struct listnode *node, *nnode; - extern struct zclient *zclient; /* it only makes sense for this to be called on a clean exit */ assert (status == 0); @@ -277,8 +276,8 @@ bgp_exit (int status) bgp_vrf_terminate (); cmd_terminate (); vty_terminate (); - if (zclient) - zclient_free (zclient); + + bgp_zebra_destroy(); if (bgp_nexthop_buf) stream_free (bgp_nexthop_buf); if (bgp_ifindices_buf) diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index b18572c07a..f63f3f8f94 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -3178,6 +3178,8 @@ bgp_delete (struct bgp *bgp) /* Free interfaces in this instance. */ bgp_if_finish (bgp); + bgp_address_destroy (bgp); + thread_master_free_unused(bm->master); bgp_unlock(bgp); /* initial reference */ -- 2.39.5