Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Quagga: Dev

[PATCH] bgpd: Fix crash when disabling dampening (BZ#687)

 

 

Quagga dev RSS feed   Index | Next | Previous | View Threaded


jorge at dti2

Apr 13, 2012, 4:46 AM

Post #1 of 2 (200 views)
Permalink
[PATCH] bgpd: Fix crash when disabling dampening (BZ#687)

From: "Jorge Boncompte [DTI2]" <jorge [at] dti2>

Vladimir Podobaev reported that the following commands crashed the
daemon.

router bgp 123
bgp dampening
no bgp dampening 1 2 3 4
no bgp dampening

The problem was that bgp_damp_info_clean() tried to dereference the
already freed reuse_list array in the second call to "no bgp dampening".

Fixed by checking in bgp_damp_disable() that the dampening it's
enabled before doing the cleanup.

Signed-off-by: Jorge Boncompte [DTI2] <jorge [at] dti2>
---
bgpd/bgp_damp.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/bgpd/bgp_damp.c b/bgpd/bgp_damp.c
index a513883..2820f17 100644
--- a/bgpd/bgp_damp.c
+++ b/bgpd/bgp_damp.c
@@ -498,6 +498,10 @@ bgp_damp_info_clean (void)
int
bgp_damp_disable (struct bgp *bgp, afi_t afi, safi_t safi)
{
+ /* If it wasn't enabled, there's nothing to do. */
+ if (! CHECK_FLAG (bgp->af_flags[afi][safi], BGP_CONFIG_DAMPENING))
+ return 0;
+
/* Cancel reuse thread. */
if (damp->t_reuse )
thread_cancel (damp->t_reuse);
--
1.7.8.3


_______________________________________________
Quagga-dev mailing list
Quagga-dev [at] lists
http://lists.quagga.net/mailman/listinfo/quagga-dev


equinox at diac24

Apr 17, 2012, 7:26 AM

Post #2 of 2 (165 views)
Permalink
Re: [PATCH] bgpd: Fix crash when disabling dampening (BZ#687) [In reply to]

On Fri, Apr 13, 2012 at 01:46:09PM +0200, Jorge Boncompte [DTI2] wrote:
> From: "Jorge Boncompte [DTI2]" <jorge [at] dti2>
>
> Vladimir Podobaev reported that the following commands crashed the
> daemon.
>
> router bgp 123
> bgp dampening
> no bgp dampening 1 2 3 4
> no bgp dampening
>
> The problem was that bgp_damp_info_clean() tried to dereference the
> already freed reuse_list array in the second call to "no bgp dampening".
>
> Fixed by checking in bgp_damp_disable() that the dampening it's
> enabled before doing the cleanup.
>
> Signed-off-by: Jorge Boncompte [DTI2] <jorge [at] dti2>

Applied, thanks.
Attachments: signature.asc (0.22 KB)

Quagga dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.