diff options
| author | Donatas Abraitis <donatas.abraitis@gmail.com> | 2021-07-30 16:48:36 +0300 | 
|---|---|---|
| committer | Donatas Abraitis <donatas.abraitis@gmail.com> | 2021-07-30 16:49:21 +0300 | 
| commit | b3aa2ed7a872478c7b9a44f1d137ba023d46017f (patch) | |
| tree | 3c046fefd3e6e7690d2fdd486572afeddc8c322f /bgpd | |
| parent | c48aaa01a3058d3887b89867042364ff20d97f92 (diff) | |
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')
| -rw-r--r-- | bgpd/bgp_damp.c | 18 | ||||
| -rw-r--r-- | bgpd/bgp_damp.h | 4 | 
2 files changed, 11 insertions, 11 deletions
diff --git a/bgpd/bgp_damp.c b/bgpd/bgp_damp.c index fca5089da5..513cfffda9 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 */ diff --git a/bgpd/bgp_damp.h b/bgpd/bgp_damp.h index d238a7a340..fc03b97c13 100644 --- a/bgpd/bgp_damp.h +++ b/bgpd/bgp_damp.h @@ -62,10 +62,10 @@ struct bgp_damp_info {  	afi_t afi;  	safi_t safi; -	LIST_ENTRY(bgp_damp_info) entry; +	SLIST_ENTRY(bgp_damp_info) entry;  }; -LIST_HEAD(reuselist, bgp_damp_info); +SLIST_HEAD(reuselist, bgp_damp_info);  /* Specified parameter set configuration. */  struct bgp_damp_config {  | 
