~ubuntu-branches/ubuntu/lucid/quagga/lucid-security

« back to all changes in this revision

Viewing changes to bgpd/bgp_damp.c

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-05-05 19:21:02 UTC
  • mfrom: (17.1.15 sid)
  • Revision ID: package-import@ubuntu.com-20120505192102-vhdjnud7ast901mj
Tags: 0.99.20.1-0ubuntu0.10.04.2
* SECURITY UPDATE: Update to 0.99.20.1 to fix multiple security issues.
  (LP: #994169)
  - Denial of service via short Link State Update packet
  - Denial of service via short network-LSA link-state advertisement
  - Denial of service via malformed Four-octet AS Number Capability
  - CVE-2012-0249
  - CVE-2012-0250
  - CVE-2012-0255
* debian/control, debian/rules: Remove quagga-dbg package for Lucid.
* debian/rules: don't use autotools_dev for Lucid.
* debian/patches/99_bgpd-fix-memory-leak-for-extra-attributes.diff:
  added fix for a bgpd memory leak related to extra attributes. Thanks to
  Debian for the regression fix.

Show diffs side-by-side

added added

removed removed

Lines of Context:
117
117
  damp->t_reuse =
118
118
    thread_add_timer (master, bgp_reuse_timer, NULL, DELTA_REUSE);
119
119
 
120
 
  t_now = time (NULL);
 
120
  t_now = bgp_clock ();
121
121
 
122
122
  /* 1.  save a pointer to the current zeroth queue head and zero the
123
123
     list head entry.  */
181
181
  struct bgp_damp_info *bdi = NULL;
182
182
  double last_penalty = 0;
183
183
  
184
 
  t_now = time (NULL);
 
184
  t_now = bgp_clock ();
185
185
 
186
186
  /* Processing Unreachable Messages.  */
187
187
  if (binfo->extra)
268
268
  if (!binfo->extra || !((bdi = binfo->extra->damp_info)))
269
269
    return BGP_DAMP_USED;
270
270
 
271
 
  t_now = time (NULL);
 
271
  t_now = bgp_clock ();
272
272
  bgp_info_unset_flag (rn, binfo, BGP_INFO_HISTORY);
273
273
 
274
274
  bdi->lastrecord = BGP_RECORD_UPDATE;
306
306
  
307
307
  assert (binfo->extra && binfo->extra->damp_info);
308
308
  
309
 
  t_now = time (NULL);
 
309
  t_now = bgp_clock ();
310
310
  bdi = binfo->extra->damp_info;
311
311
 
312
312
  if (CHECK_FLAG (binfo->flags, BGP_INFO_DAMPED))
407
407
  damp->reuse_list = XCALLOC (MTYPE_BGP_DAMP_ARRAY, 
408
408
                              damp->reuse_list_size 
409
409
                              * sizeof (struct bgp_reuse_node *));
410
 
  memset (damp->reuse_list, 0x00, 
411
 
          damp->reuse_list_size * sizeof (struct bgp_reuse_node *));  
412
410
 
413
411
  /* Reuse-array computations */
414
 
  damp->reuse_index = XMALLOC (MTYPE_BGP_DAMP_ARRAY, 
 
412
  damp->reuse_index = XCALLOC (MTYPE_BGP_DAMP_ARRAY,
415
413
                               sizeof(int) * damp->reuse_index_size);
416
 
  memset (damp->reuse_index, 0x00,
417
 
          damp->reuse_list_size * sizeof (int));
418
414
 
419
415
  reuse_max_ratio = (double)damp->ceiling/damp->reuse_limit;
420
416
  j = (exp((double)damp->max_suppress_time/damp->half_life) * log10(2.0));
597
593
    return;
598
594
 
599
595
  /* Calculate new penalty.  */
600
 
  t_now = time (NULL);
 
596
  t_now = bgp_clock ();
601
597
  t_diff = t_now - bdi->t_updated;
602
598
  penalty = bgp_damp_decay (t_diff, bdi->penalty);
603
599
 
633
629
    return NULL;
634
630
 
635
631
  /* Calculate new penalty.  */
636
 
  t_now = time (NULL);
 
632
  t_now = bgp_clock ();
637
633
  t_diff = t_now - bdi->t_updated;
638
634
  penalty = bgp_damp_decay (t_diff, bdi->penalty);
639
635