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 <lberger@labn.net>
(cherry picked from commit 637035710a2f8e1e5944ee714135b7f88ac15ac4)
This commit is contained in:
Lou Berger 2016-01-12 13:42:03 -05:00 committed by Donald Sharp
parent f43e655ed8
commit 2f35bbfe74
2 changed files with 4 additions and 3 deletions

View File

@ -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)

View File

@ -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 */