Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bgpd: fix missing list add in dampening #9225

Merged
merged 1 commit into from
Jul 29, 2021

Conversation

idryzhov
Copy link
Contributor

One more crash in dampening code...

When bgp_damp_withdraw is called, if there's already a BDI structure,
bgp_damp_info_claim is called to re-assign the bdi->config in case it
was changed. The problem is that bgp_damp_info_claim actually removes
the BDI from the reuse list of the old config and never adds it to the
reuse list of the new config. We must do this to prevent the crash
because all the code assumes that BDI is always in some list.

Signed-off-by: Igor Ryzhov iryzhov@nfware.com

Copy link

@polychaeta polychaeta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution to FRR!

Click for style suggestions

To apply these suggestions:

curl -s https://gist.githubusercontent.com/polychaeta/cbb5c37a3bf7b013786d94c572905728/raw/5e05fca32f721d7eaeeae9705b31a9584fb3f9c3/cr_9225_1627559028.diff | git apply

diff --git a/bgpd/bgp_damp.c b/bgpd/bgp_damp.c
index 1d87f47e5..fcf1e4cda 100644
--- a/bgpd/bgp_damp.c
+++ b/bgpd/bgp_damp.c
@@ -347,7 +347,8 @@ int bgp_damp_withdraw(struct bgp_path_info *path, struct bgp_dest *dest,
 			if (bdi->index == BGP_DAMP_NO_REUSE_LIST_INDEX)
 				bgp_reuselist_add(&bdc->no_reuse_list, bdi);
 			else
-				bgp_reuselist_add(&bdc->reuse_list[bdi->index], bdi);
+				bgp_reuselist_add(&bdc->reuse_list[bdi->index],
+						  bdi);
 		}
 		last_penalty = bdi->penalty;
 

If you are a new contributor to FRR, please see our contributing guidelines.

After making changes, you do not need to create a new PR. You should perform an amend or interactive rebase followed by a force push.

One more crash in dampening code...

When bgp_damp_withdraw is called, if there's already a BDI structure,
bgp_damp_info_claim is called to re-assign the bdi->config in case it
was changed. The problem is that bgp_damp_info_claim actually removes
the BDI from the reuse list of the old config and never adds it to the
reuse list of the new config. We must do this to prevent the crash
because all the code assumes that BDI is always in some list.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
@idryzhov idryzhov force-pushed the bgp-damp-list-readd branch from 4568381 to cd58568 Compare July 29, 2021 11:44
@LabN-CI
Copy link
Collaborator

LabN-CI commented Jul 29, 2021

💚 Basic BGPD CI results: SUCCESS, 0 tests failed

Results table
_ _
Result SUCCESS git merge/9225 cd58568
Date 07/29/2021
Start 07:45:54
Finish 08:11:25
Run-Time 25:31
Total 1813
Pass 1813
Fail 0
Valgrind-Errors
Valgrind-Loss
Details vncregress-2021-07-29-07:45:54.txt
Log autoscript-2021-07-29-07:47:06.log.bz2
Memory 516 517 430

For details, please contact louberger

@NetDEF-CI
Copy link
Collaborator

NetDEF-CI commented Jul 29, 2021

Continuous Integration Result: SUCCESSFUL

Continuous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF / OpenSourceRouting.org CI System

CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-20626/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

Warnings Generated during build:

Checkout code: Successful with additional warnings
Report for bgp_damp.c | 2 issues
===============================================
< WARNING: line over 80 characters
< #350: FILE: /tmp/f1-31761/bgp_damp.c:350:

@NetDEF-CI
Copy link
Collaborator

Continuous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF / OpenSourceRouting.org CI System

CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-20627/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

Copy link
Member

@riw777 riw777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@riw777 riw777 merged commit cdb68e8 into FRRouting:master Jul 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants