-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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: config connect timer not applied immediately for non-established peers. #7449
bgpd: config connect timer not applied immediately for non-established peers. #7449
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/21cfe5b2e07a924983b6036b1167a5e4/raw/0d0cf4ce9899f8865166fab7faaa0323fa85c47f/cr_7449_1604467447.diff | git apply
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index cc114bb94..aa9b592c8 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -5166,11 +5166,12 @@ int peer_timers_connect_set(struct peer *peer, uint32_t connect)
peer->connect = connect;
peer->v_connect = connect;
- if (!CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP) && (peer->status != Established) ) {
- if (peer_active(peer))
- BGP_EVENT_ADD(peer, BGP_Stop);
- BGP_EVENT_ADD(peer, BGP_Start);
- }
+ if (!CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP)
+ && (peer->status != Established)) {
+ if (peer_active(peer))
+ BGP_EVENT_ADD(peer, BGP_Stop);
+ BGP_EVENT_ADD(peer, BGP_Start);
+ }
/* Skip peer-group mechanics for regular peers. */
if (!CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP))
@@ -5190,12 +5191,11 @@ int peer_timers_connect_set(struct peer *peer, uint32_t connect)
member->connect = connect;
member->v_connect = connect;
- if (member->status != Established) {
- if (peer_active(member))
- BGP_EVENT_ADD(member, BGP_Stop);
- BGP_EVENT_ADD(member, BGP_Start);
- }
-
+ if (member->status != Established) {
+ if (peer_active(member))
+ BGP_EVENT_ADD(member, BGP_Stop);
+ BGP_EVENT_ADD(member, BGP_Start);
+ }
}
return 0;
@@ -5222,11 +5222,12 @@ int peer_timers_connect_unset(struct peer *peer)
else
peer->v_connect = peer->bgp->default_connect_retry;
- if (!CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP) && (peer->status != Established) ) {
- if (peer_active(peer))
- BGP_EVENT_ADD(peer, BGP_Stop);
- BGP_EVENT_ADD(peer, BGP_Start);
- }
+ if (!CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP)
+ && (peer->status != Established)) {
+ if (peer_active(peer))
+ BGP_EVENT_ADD(peer, BGP_Stop);
+ BGP_EVENT_ADD(peer, BGP_Start);
+ }
/* Skip peer-group mechanics for regular peers. */
if (!CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP))
@@ -5246,11 +5247,11 @@ int peer_timers_connect_unset(struct peer *peer)
member->connect = 0;
member->v_connect = peer->bgp->default_connect_retry;
- if (member->status != Established) {
- if (peer_active(member))
- BGP_EVENT_ADD(member, BGP_Stop);
- BGP_EVENT_ADD(member, BGP_Start);
- }
+ if (member->status != Established) {
+ if (peer_active(member))
+ BGP_EVENT_ADD(member, BGP_Stop);
+ BGP_EVENT_ADD(member, BGP_Start);
+ }
}
return 0;
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.
Outdated results 💚Basic BGPD CI results: SUCCESS, 0 tests failed
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-15166/ This is a comment from an automated CI system. Warnings Generated during build:Checkout code: Successful with additional warnings
Warnings Generated during build:Debian 10 amd64 build: Successful with additional warningsDebian Package lintian failed for Debian 10 amd64 build:
CLANG Static Analyzer Summary
No Changes in Static Analysis warnings compared to base3 Static Analyzer issues remaining.See details at |
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.
Please use clang-formater first.
Hi, |
What do you mean "Our git here"? |
While the changes looks good formating is still not ok. |
@sudhanshukumar22 can you please go to your FRR folder and apply this? |
e2b4100
to
29011c3
Compare
I have made the changes. |
Done |
Outdated results 💚Basic BGPD CI results: SUCCESS, 0 tests failed
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-16676/ This is a comment from an automated CI system. Warnings Generated during build:Debian 10 amd64 build: Successful with additional warningsDebian Package lintian failed for Debian 10 amd64 build:
|
@ton31337 ,The changes are done. Please review the changes. |
4265dc2
to
b090bfd
Compare
Outdated results 💚Basic BGPD CI results: SUCCESS, 0 tests failed
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-16868/ This is a comment from an automated CI system. Warnings Generated during build:Debian 10 amd64 build: Successful with additional warningsDebian Package lintian failed for Debian 10 amd64 build:
|
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-16869/ This is a comment from an automated CI system. Warnings Generated during build:Debian 10 amd64 build: Successful with additional warningsDebian Package lintian failed for Debian 10 amd64 build:
|
b090bfd
to
2030b81
Compare
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/09181166485208d1eed9e97d390bb1fb/raw/9e95998cd301218e2887973cd3f4135223c8751e/cr_7449_1612261404.diff | git apply
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index 30b538220..50086315c 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -5305,8 +5305,7 @@ int peer_timers_connect_set(struct peer *peer, uint32_t connect)
peer->v_connect = connect;
/* Skip peer-group mechanics for regular peers. */
- if (!CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP))
- {
+ if (!CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP)) {
if (peer->status != Established) {
if (peer_active(peer))
BGP_EVENT_ADD(peer, BGP_Stop);
@@ -5360,8 +5359,7 @@ int peer_timers_connect_unset(struct peer *peer)
peer->v_connect = peer->bgp->default_connect_retry;
/* Skip peer-group mechanics for regular peers. */
- if (!CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP))
- {
+ if (!CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP)) {
if (peer->status != Established) {
if (peer_active(peer))
BGP_EVENT_ADD(peer, BGP_Stop);
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.
…n-established state. Description: When user is config connect timer, it doesn't reflect immediately. It reflect when next time neighbor is tried to reconnect. Problem Description/Summary : When user is config connect timer, it doesn't reflect The network connection was aborted by the local system.d to reconnect. Fix is to update the connect timer immediately if BGP session is not in establish state. Expected Behavior : If neighbor is not yet established, we should immediately apply the config connect timer to the peer. Signed-off-by: sudhanshukumar22 <sudhanshu.kumar@broadcom.com>
2030b81
to
91de6fa
Compare
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.
LGTM now.
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-16890/ This is a comment from an automated CI system. Warnings Generated during build:Debian 10 amd64 build: Successful with additional warningsDebian Package lintian failed for Debian 10 amd64 build:
|
💚 Basic BGPD CI results: SUCCESS, 0 tests failedResults table
For details, please contact louberger |
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-16889/ This is a comment from an automated CI system. Warnings Generated during build:Checkout code: Successful with additional warnings
Warnings Generated during build:Debian 10 amd64 build: Successful with additional warningsDebian Package lintian failed for Debian 10 amd64 build:
|
Description:
When user is config connect timer, it doesn't reflect
immediately. It reflect when next time neighbor is tried to reconnect.
Problem Description/Summary :
When user is config connect timer, it doesn't reflect
The network connection was aborted by the local system.d to reconnect.
Fix is to update the connect timer immediately if BGP
session is not in establish state.
Expected Behavior :
If neighbor is not yet established, we should immediately apply the config connect timer to the peer.
Signed-off-by: sudhanshukumar22 sudhanshu.kumar@broadcom.com