diff --git a/bgpd/bgp_damp.c b/bgpd/bgp_damp.c index 6d2dc1a65a..513cfffda9 100644 --- a/bgpd/bgp_damp.c +++ b/bgpd/bgp_damp.c @@ -227,7 +227,6 @@ static int bgp_reuse_timer(struct thread *t) } if (bdi->penalty <= bdc->reuse_limit / 2.0) { - bgp_reuselist_del(&plist, bdi); bgp_damp_info_free(bdi, 1); } else { bdi->index = BGP_DAMP_NO_REUSE_LIST_INDEX; @@ -376,10 +375,8 @@ int bgp_damp_update(struct bgp_path_info *path, struct bgp_dest *dest, if (bdi->penalty > bdc->reuse_limit / 2.0) bdi->t_updated = t_now; - else { - bgp_damp_info_unclaim(bdi); + else bgp_damp_info_free(bdi, 0); - } return status; } @@ -388,6 +385,8 @@ void bgp_damp_info_free(struct bgp_damp_info *bdi, int withdraw) { assert(bdi); + bgp_damp_info_unclaim(bdi); + bdi->path->extra->damp_info = NULL; bgp_path_info_unset_flag(bdi->dest, bdi->path, BGP_PATH_HISTORY | BGP_PATH_DAMPED); @@ -505,15 +504,12 @@ void bgp_damp_info_clean(struct bgp *bgp, struct bgp_damp_config *bdc, bgp_process(bgp, bdi->dest, bdi->afi, bdi->safi); } - bgp_reuselist_del(list, bdi); bgp_damp_info_free(bdi, 1); } } - while ((bdi = SLIST_FIRST(&bdc->no_reuse_list)) != NULL) { - bgp_reuselist_del(&bdc->no_reuse_list, bdi); + while ((bdi = SLIST_FIRST(&bdc->no_reuse_list)) != NULL) bgp_damp_info_free(bdi, 1); - } /* Free decay array */ XFREE(MTYPE_BGP_DAMP_ARRAY, bdc->decay_array);