[quagga-dev 8131] Re: [PATCH 09/10] BGP: use XCALLOC to allocate bgpd damp array

Balaji G balajig81 at gmail.com
Sun Aug 8 12:19:36 BST 2010


Applied, Thanks.

Cheers,
  - Balaji

On Thu, Aug 5, 2010 at 10:56 PM, Stephen Hemminger <shemminger at vyatta.com>wrote:

> The BGP reuse_index is not initialized properly.
> This would cause sporadic crash when disabling dampening.
> Use XCALLOC correctly and the right size array is initialized
> and no memset is needed.
>
> ---
>  bgpd/bgp_damp.c |    6 +-----
>  1 files changed, 1 insertions(+), 5 deletions(-)
>
> --- a/bgpd/bgp_damp.c   2010-08-05 09:33:09.585352707 -0700
> +++ b/bgpd/bgp_damp.c   2010-08-05 10:15:34.718676270 -0700
> @@ -407,14 +407,10 @@ bgp_damp_parameter_set (int hlife, int r
>   damp->reuse_list = XCALLOC (MTYPE_BGP_DAMP_ARRAY,
>                              damp->reuse_list_size
>                              * sizeof (struct bgp_reuse_node *));
> -  memset (damp->reuse_list, 0x00,
> -          damp->reuse_list_size * sizeof (struct bgp_reuse_node *));
>
>   /* Reuse-array computations */
> -  damp->reuse_index = XMALLOC (MTYPE_BGP_DAMP_ARRAY,
> +  damp->reuse_index = XCALLOC (MTYPE_BGP_DAMP_ARRAY,
>                               sizeof(int) * damp->reuse_index_size);
> -  memset (damp->reuse_index, 0x00,
> -          damp->reuse_list_size * sizeof (int));
>
>   reuse_max_ratio = (double)damp->ceiling/damp->reuse_limit;
>   j = (exp((double)damp->max_suppress_time/damp->half_life) * log10(2.0));
>
>
> _______________________________________________
> Quagga-dev mailing list
> Quagga-dev at lists.quagga.net
> http://lists.quagga.net/mailman/listinfo/quagga-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quagga.net/pipermail/quagga-dev/attachments/20100808/76615d25/attachment-0001.html>


More information about the Quagga-dev mailing list