-
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
ospfd: fix counting of "ip ospf area" commands #8362
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/c65c736438d848048a124b0565c47f7b/raw/0301ff927685c765f0c0b173ba8f4bbe8763181b/cr_8362_1617018796.diff | git apply
diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c
index 20384108f..6829c4a34 100644
--- a/ospfd/ospf_interface.c
+++ b/ospfd/ospf_interface.c
@@ -1283,7 +1283,8 @@ uint32_t ospf_if_count_area_params(struct interface *ifp)
count++;
for (rn = route_top(IF_OIFS_PARAMS(ifp)); rn; rn = route_next(rn))
- if ((params = rn->info) && OSPF_IF_PARAM_CONFIGURED(params, if_area))
+ if ((params = rn->info)
+ && OSPF_IF_PARAM_CONFIGURED(params, if_area))
count++;
return count;
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-18051/ This is a comment from an automated CI system. Warnings Generated during build:Checkout code: Successful with additional warnings
|
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 fine - had a couple of minor style nits
ospfd/ospf_vty.c
Outdated
@@ -8823,7 +8825,6 @@ DEFUN (ip_ospf_area, | |||
ospf = ospf_lookup_by_vrf_id(ifp->vrf_id); | |||
if (ospf) { |
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: don't need the braces anymore?
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.
Fixed
ospfd/ospf_vty.c
Outdated
@@ -8884,7 +8885,6 @@ DEFUN (ip_ospf_area, | |||
|
|||
if (ospf) { |
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: don't need the braces?
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.
Fixed
Instead of trying to maintain if_ospf_cli_count, let's directly count the number of configured interfaces when it is needed. Current approach sometimes leads to an incorrect counter. Fixes FRRouting#8321. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
60f84ff
to
cbf32f7
Compare
💚 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-18073/ This is a comment from an automated CI system. |
Instead of trying to maintain if_ospf_cli_count, let's directly count
the number of configured interfaces when it is needed. Current approach
sometimes leads to an incorrect counter.
Fixes #8321.
Signed-off-by: Igor Ryzhov iryzhov@nfware.com