]> git.puffer.fish Git - matthieu/frr.git/commit
[bgpd] reference count the BGP instance
authorStephen Hemminger <shemminger@vyatta.com>
Thu, 21 May 2009 15:51:03 +0000 (08:51 -0700)
committerPaul Jakma <paul@quagga.net>
Thu, 18 Jun 2009 19:18:28 +0000 (20:18 +0100)
commit0088b5dc55a91d27e572484e61df71b8ca2eddf4
treef93714f98d12890f961794cd026b6bf2de75105e
parentdde7258666fd73878b4cc10b4b5b7c07e9be049e
[bgpd] reference count the BGP instance

When a BGP instance is deleted with lots of routes and neighbors
it is possible for the peer rsclient queue to run after
bgp_delete has been called. This would lead to bgpd crashing,
see https://bugzilla.vyatta.com/show_bug.cgi?id=3436

The fix is to add reference counting to the BGP instance and defer
actual freeing until all references are gone.

This patch also fixes a memory leak where the self-reference
peer instance was being created but never freed.

The check in bgp_clear_route is no longer valid because it is possible
for it to be called when peer is in Deleted state during cleanup.
bgpd/bgp_route.c
bgpd/bgpd.c
bgpd/bgpd.h