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

ospfd: fix counting of "ip ospf area" commands #8362

Merged
merged 1 commit into from
Mar 30, 2021

Conversation

idryzhov
Copy link
Contributor

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

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/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.

@LabN-CI
Copy link
Collaborator

LabN-CI commented Mar 29, 2021

Outdated results 💚

Basic BGPD CI results: SUCCESS, 0 tests failed

_ _
Result SUCCESS git merge/8362 60f84ff
Date 03/29/2021
Start 09:00:40
Finish 09:40:19
Run-Time 39:39
Total 1815
Pass 1815
Fail 0
Valgrind-Errors 0
Valgrind-Loss 0
Details vncregress-2021-03-29-09:00:40.txt
Log autoscript-2021-03-29-09:01:50.log.bz2
Memory 503 506 430

For details, please contact louberger

@NetDEF-CI
Copy link
Collaborator

NetDEF-CI commented Mar 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-18051/

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 ospf_vty.c | 4 issues
===============================================
< WARNING: braces {} are not necessary for single statement blocks
< #8878: FILE: /tmp/f1-8185/ospf_vty.c:8878:
< WARNING: braces {} are not necessary for single statement blocks
< #8938: FILE: /tmp/f1-8185/ospf_vty.c:8938:

Copy link
Contributor

@mjstapp mjstapp left a 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) {
Copy link
Contributor

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?

Copy link
Contributor Author

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) {
Copy link
Contributor

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?

Copy link
Contributor Author

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>
@idryzhov idryzhov force-pushed the fix-ospf-cli-count branch from 60f84ff to cbf32f7 Compare March 30, 2021 08:51
@LabN-CI
Copy link
Collaborator

LabN-CI commented Mar 30, 2021

💚 Basic BGPD CI results: SUCCESS, 0 tests failed

Results table
_ _
Result SUCCESS git merge/8362 cbf32f7
Date 03/30/2021
Start 05:55:51
Finish 06:35:21
Run-Time 39:30
Total 1815
Pass 1815
Fail 0
Valgrind-Errors 0
Valgrind-Loss 0
Details vncregress-2021-03-30-05:55:51.txt
Log autoscript-2021-03-30-05:57:01.log.bz2
Memory 490 450 429

For details, please contact louberger

@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-18073/

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.

@mjstapp mjstapp merged commit 5c9254b into FRRouting:master Mar 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ospf wrong calculate ospf_network_area counter
5 participants