-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Conversation
There was a problem hiding this 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>
4568381
to
cd58568
Compare
💚 Basic BGPD CI results: SUCCESS, 0 tests failedResults table
For details, please contact louberger |
Continuous Integration Result: SUCCESSFULContinuous Integration Result: SUCCESSFULCongratulations, 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. Warnings Generated during build:Checkout code: Successful with additional warnings
|
Continuous Integration Result: SUCCESSFULCongratulations, 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
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