-
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
ospf6d : Send LSA update immediately when ospf instance is deleted #8978
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/825217b7bc967974887f76bcc10dc5ce/raw/c0ce36a6e091990a44328d8b07184ca786e95c82/cr_8978_1625400901.diff | git apply
diff --git a/ospf6d/ospf6_message.c b/ospf6d/ospf6_message.c
index 6bd6ef0c8..8af1571dc 100644
--- a/ospf6d/ospf6_message.c
+++ b/ospf6d/ospf6_message.c
@@ -2356,8 +2356,10 @@ static void ospf6_send_lsupdate(struct ospf6_neighbor *on,
}
if (oi) {
ospf6_packet_add(oi, op);
- /* If ospf instance is being deleted, send the packet immediately */
- if (oi->area && oi->area->ospf6 && oi->area->ospf6->inst_shutdown) {
+ /* If ospf instance is being deleted, send the packet
+ * immediately */
+ if (oi->area && oi->area->ospf6
+ && oi->area->ospf6->inst_shutdown) {
struct thread os_packet_thd;
os_packet_thd.arg = (void *)oi->area->ospf6;
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 |
Outdated results 💚Basic BGPD CI results: SUCCESS, 0 tests failed
For details, please contact louberger |
Continuous Integration Result: FAILEDContinuous Integration Result: FAILEDSee below for issues. This is a comment from an automated CI system. Get source / Pull Request: SuccessfulBuilding Stage: SuccessfulBasic Tests: FailedTopotests Ubuntu 18.04 i386 part 8: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TOPO8U18I386-20042/test Topology Tests failed for Topotests Ubuntu 18.04 i386 part 8:
see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-20042/artifact/TOPO8U18I386/ErrorLog/log_topotests.txt Successful on other platforms/tests
Warnings Generated during build:Checkout code: Successful with additional warningsTopotests Ubuntu 18.04 i386 part 8: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TOPO8U18I386-20042/test Topology Tests failed for Topotests Ubuntu 18.04 i386 part 8:
see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-20042/artifact/TOPO8U18I386/ErrorLog/log_topotests.txt
CLANG Static Analyzer Summary
2 Static Analyzer issues remaining.See details at |
Continuous Integration Result: FAILEDContinuous Integration Result: FAILEDSee below for issues. This is a comment from an automated CI system. Get source / Pull Request: SuccessfulBuilding Stage: SuccessfulBasic Tests: FailedTopotests debian 10 amd64 part 1: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TOPO1DEB10AMD64-20043/test Topology Tests failed for Topotests debian 10 amd64 part 1:
see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-20043/artifact/TOPO1DEB10AMD64/ErrorLog/log_topotests.txt Successful on other platforms/tests
Warnings Generated during build:Checkout code: Successful with additional warningsTopotests debian 10 amd64 part 1: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TOPO1DEB10AMD64-20043/test Topology Tests failed for Topotests debian 10 amd64 part 1:
see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-20043/artifact/TOPO1DEB10AMD64/ErrorLog/log_topotests.txt
CLANG Static Analyzer Summary
2 Static Analyzer issues remaining.See details at |
ci:rerun |
Continuous Integration Result: FAILEDContinuous Integration Result: FAILEDSee below for issues. This is a comment from an automated CI system. Get source / Pull Request: SuccessfulBuilding Stage: SuccessfulBasic Tests: FailedTopotests Ubuntu 18.04 amd64 part 1: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TP1U1804AMD64-20051/test Topology Tests failed for Topotests Ubuntu 18.04 amd64 part 1:
see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-20051/artifact/TP1U1804AMD64/ErrorLog/log_topotests.txt Successful on other platforms/tests
Warnings Generated during build:Checkout code: Successful with additional warningsTopotests Ubuntu 18.04 amd64 part 1: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TP1U1804AMD64-20051/test Topology Tests failed for Topotests Ubuntu 18.04 amd64 part 1:
see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-20051/artifact/TP1U1804AMD64/ErrorLog/log_topotests.txt
CLANG Static Analyzer Summary
2 Static Analyzer issues remaining.See details at |
ci:rerun |
ospf6d/ospf6_message.c
Outdated
/* If ospf instance is being deleted, send the packet | ||
* immediately */ | ||
if (oi->area && oi->area->ospf6 | ||
&& oi->area->ospf6->inst_shutdown) { |
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.
ospf6_flood_interface function already takes care of sending the LSAs immediately if instance is getting deleted and is having the same check. Please re-check once.
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.
ospf6_lsupdate_send_neighbor_now() is called from ospf6_flood_interface() which checks for inst_shutdown and the write thread is added in ospf6_send_lsupdate(). Since the ospf instance is getting deleted, ospf6_write() should be called directly instead of adding write thread. The issue observed is that LSAs does not get deleted immediately from peer router database. it gets deleted after timeout. Therefore calling write() directly is required. Similar functionality is present in ospfv2 code ospf_ls_upd_queue_send() function
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.
Okay got it. The changes looks fine to me.
Continuous Integration Result: FAILEDContinuous Integration Result: FAILEDSee below for issues. This is a comment from an automated CI system. Get source / Pull Request: SuccessfulBuilding Stage: SuccessfulBasic Tests: FailedTopotests Ubuntu 18.04 amd64 part 9: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TOPO9U18AMD64-20061/test Topology Tests failed for Topotests Ubuntu 18.04 amd64 part 9:
see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-20061/artifact/TOPO9U18AMD64/ErrorLog/log_topotests.txt Successful on other platforms/tests
Warnings Generated during build:Checkout code: Successful with additional warningsTopotests Ubuntu 18.04 amd64 part 9: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TOPO9U18AMD64-20061/test Topology Tests failed for Topotests Ubuntu 18.04 amd64 part 9:
see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-20061/artifact/TOPO9U18AMD64/ErrorLog/log_topotests.txt
CLANG Static Analyzer Summary
2 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.
looks good
CI:RERUN |
Continuous Integration Result: FAILEDContinuous Integration Result: FAILEDSee below for issues. This is a comment from an automated CI system. Get source / Pull Request: SuccessfulBuilding Stage: SuccessfulBasic Tests: FailedTopotests Ubuntu 18.04 amd64 part 9: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TOPO9U18AMD64-20091/test Topology Tests failed for Topotests Ubuntu 18.04 amd64 part 9:
see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-20091/artifact/TOPO9U18AMD64/ErrorLog/log_topotests.txt Successful on other platforms/tests
Warnings Generated during build:Checkout code: Successful with additional warningsTopotests Ubuntu 18.04 amd64 part 9: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TOPO9U18AMD64-20091/test Topology Tests failed for Topotests Ubuntu 18.04 amd64 part 9:
see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-20091/artifact/TOPO9U18AMD64/ErrorLog/log_topotests.txt
CLANG Static Analyzer Summary
2 Static Analyzer issues remaining.See details at |
ospf6d/ospf6_message.c
Outdated
@@ -2356,7 +2356,20 @@ static void ospf6_send_lsupdate(struct ospf6_neighbor *on, | |||
} | |||
if (oi) { | |||
ospf6_packet_add(oi, op); | |||
OSPF6_MESSAGE_WRITE_ON(oi); | |||
/* If ospf instance is being deleted, send the packet | |||
* immediately */ |
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 fix this warning:
Report for ospf6_message.c | 2 issues
< WARNING: Block comments use a trailing */ on a separate line
< #2360: FILE: /tmp/f1-27009/ospf6_message.c:2360:
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 fix the warning.
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.
Reminder: please fix the static analyzer warnings.
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-20119/ This is a comment from an automated CI system. |
updated the code changes |
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.
Just two nits to improve code.
ospf6d/ospf6_message.c
Outdated
if (oi->area->ospf6->inst_shutdown) { | ||
struct thread os_packet_thd; | ||
|
||
os_packet_thd.arg = (void *)oi->area->ospf6; |
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.
Nit:
You don't need to cast to void.
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.
removed this code as per the below comments
ospf6d/ospf6_message.c
Outdated
listnode_add(oi->area->ospf6->oi_write_q, oi); | ||
oi->on_write_q = 1; | ||
} | ||
ospf6_write(&os_packet_thd); |
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.
I think this could be smaller code if you use thread_execute
instead of generating a struct thread
. As a bonus you get slow function execution warnings.
Example:
thread_execute(master, ospf6_write, oi->area->ospf6, 0);
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.
changed to thread_execute
Fix: The fix is to call ospf6_write to send the packet immediately to all neighbors Signed-off-by: kssoman <somanks@gmail.com>
💚 Basic BGPD CI results: SUCCESS, 0 tests failedResults table
For details, please contact louberger |
Continuous Integration Result: FAILEDContinuous Integration Result: FAILEDSee below for issues. This is a comment from an automated CI system. Get source / Pull Request: SuccessfulBuilding Stage: SuccessfulBasic Tests: FailedTopotests Ubuntu 18.04 i386 part 4: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TOPO4U18I386-20125/test Topology Tests failed for Topotests Ubuntu 18.04 i386 part 4:
see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-20125/artifact/TOPO4U18I386/ErrorLog/log_topotests.txt Topotests Ubuntu 18.04 arm8 part 4: Failed (click for details)Topotests Ubuntu 18.04 arm8 part 4: No useful log foundTopotests debian 10 amd64 part 4: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TOPO4DEB10AMD64-20125/test Topology Tests failed for Topotests debian 10 amd64 part 4:
see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-20125/artifact/TOPO4DEB10AMD64/ErrorLog/log_topotests.txt Successful on other platforms/tests
|
ci:rerun |
Continuous Integration Result: FAILEDSee below for issues. This is a comment from an automated CI system. Get source / Pull Request: SuccessfulBuilding Stage: SuccessfulBasic Tests: FailedTopotests Ubuntu 18.04 amd64 part 8: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TOPO8U18ARM64-20145/test Topology Tests failed for Topotests Ubuntu 18.04 amd64 part 8:
see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-20145/artifact/TOPO8U18ARM64/ErrorLog/log_topotests.txt Successful on other platforms/tests
|
Merging... CI failed twice on unrelated tests. |
@Mergifyio backport stable/8.0 |
Command
|
Fix: The fix is to call ospf6_write to send the packet immediately to all neighbors
Signed-off-by: kssoman somanks@gmail.com