summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_damp.c
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas.abraitis@gmail.com>2021-07-30 15:48:36 +0200
committerDonatas Abraitis <donatas.abraitis@gmail.com>2021-07-30 15:49:21 +0200
commitb3aa2ed7a872478c7b9a44f1d137ba023d46017f (patch)
tree3c046fefd3e6e7690d2fdd486572afeddc8c322f /bgpd/bgp_damp.c
parentMerge pull request #9217 from idryzhov/bgp-damp-leaks (diff)
downloadfrr-b3aa2ed7a872478c7b9a44f1d137ba023d46017f.tar.xz
frr-b3aa2ed7a872478c7b9a44f1d137ba023d46017f.zip
Revert "bgpd: use double-linked list instead of single-linked list in dampening"
Tested with full feed, this stucks and bgpd even stops responding. ``` [T58XM-TP956][EC 268435457] bgpd state -> unresponsive : no response yet to ping sent 90 seconds ago ``` This reverts commit db0e636dc45f9bd2c76528a8368332c56f2c8f1e. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Diffstat (limited to 'bgpd/bgp_damp.c')
-rw-r--r--bgpd/bgp_damp.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/bgpd/bgp_damp.c b/bgpd/bgp_damp.c
index fca5089da..513cfffda 100644
--- a/bgpd/bgp_damp.c
+++ b/bgpd/bgp_damp.c
@@ -41,14 +41,14 @@ static void bgp_reuselist_add(struct reuselist *list,
struct bgp_damp_info *info)
{
assert(info);
- LIST_INSERT_HEAD(list, info, entry);
+ SLIST_INSERT_HEAD(list, info, entry);
}
static void bgp_reuselist_del(struct reuselist *list,
struct bgp_damp_info *info)
{
assert(info);
- LIST_REMOVE(info, entry);
+ SLIST_REMOVE(list, info, bgp_damp_info, entry);
}
static void bgp_reuselist_switch(struct reuselist *source,
@@ -56,8 +56,8 @@ static void bgp_reuselist_switch(struct reuselist *source,
struct reuselist *target)
{
assert(source && target && info);
- LIST_REMOVE(info, entry);
- LIST_INSERT_HEAD(target, info, entry);
+ SLIST_REMOVE(source, info, bgp_damp_info, entry);
+ SLIST_INSERT_HEAD(target, info, entry);
}
static void bgp_damp_info_unclaim(struct bgp_damp_info *bdi)
@@ -188,7 +188,7 @@ static int bgp_reuse_timer(struct thread *t)
* list head entry. */
assert(bdc->reuse_offset < bdc->reuse_list_size);
plist = bdc->reuse_list[bdc->reuse_offset];
- LIST_INIT(&bdc->reuse_list[bdc->reuse_offset]);
+ SLIST_INIT(&bdc->reuse_list[bdc->reuse_offset]);
/* 2. set offset = modulo reuse-list-size ( offset + 1 ), thereby
rotating the circular queue of list-heads. */
@@ -196,7 +196,7 @@ static int bgp_reuse_timer(struct thread *t)
assert(bdc->reuse_offset < bdc->reuse_list_size);
/* 3. if ( the saved list head pointer is non-empty ) */
- while ((bdi = LIST_FIRST(&plist)) != NULL) {
+ while ((bdi = SLIST_FIRST(&plist)) != NULL) {
bgp = bdi->path->peer->bgp;
/* Set t-diff = t-now - t-updated. */
@@ -242,7 +242,7 @@ static int bgp_reuse_timer(struct thread *t)
}
}
- assert(LIST_EMPTY(&plist));
+ assert(SLIST_EMPTY(&plist));
return 0;
}
@@ -496,7 +496,7 @@ void bgp_damp_info_clean(struct bgp *bgp, struct bgp_damp_config *bdc,
bdc->reuse_offset = 0;
for (i = 0; i < bdc->reuse_list_size; ++i) {
list = &bdc->reuse_list[i];
- while ((bdi = LIST_FIRST(list)) != NULL) {
+ while ((bdi = SLIST_FIRST(list)) != NULL) {
if (bdi->lastrecord == BGP_RECORD_UPDATE) {
bgp_aggregate_increment(bgp, &bdi->dest->p,
bdi->path, bdi->afi,
@@ -508,7 +508,7 @@ void bgp_damp_info_clean(struct bgp *bgp, struct bgp_damp_config *bdc,
}
}
- while ((bdi = LIST_FIRST(&bdc->no_reuse_list)) != NULL)
+ while ((bdi = SLIST_FIRST(&bdc->no_reuse_list)) != NULL)
bgp_damp_info_free(bdi, 1);
/* Free decay array */