[quagga-dev 9004] [PATCH] bgpd: fix leak from soft reconfig

Stephen Hemminger shemminger at vyatta.com
Thu Jan 5 17:32:04 GMT 2012


When soft-reconfig is used the advertised routes are stored and
never cleared when session is lost. This means peer still has reference
and all other memory is held as well.
---
 bgpd/bgp_fsm.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

--- a/bgpd/bgp_fsm.c	2011-10-10 08:32:32.384321044 -0700
+++ b/bgpd/bgp_fsm.c	2012-01-05 09:30:16.955532576 -0800
@@ -546,6 +546,10 @@ bgp_stop (struct peer *peer)
         /* ORF received prefix-filter pnt */
         sprintf (orf_name, "%s.%d.%d", peer->host, afi, safi);
         prefix_bgp_orf_remove_all (orf_name);
+
+	/* Drop soft reconfig info */
+	if (CHECK_FLAG (peer->af_flags[afi][safi], PEER_FLAG_SOFT_RECONFIG))
+	  bgp_clear_adj_in (peer, afi, safi);
       }
 
   /* Reset keepalive and holdtime */



More information about the Quagga-dev mailing list