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

bgpd: fix and improve snmp peer lookups #2207

Merged
merged 1 commit into from
May 11, 2018

Conversation

ppmathis
Copy link
Member

The previous implementation of bgp_peer_lookup_next did not consider the
internal ordering of peers when using peer groups, which led to all
standalone peers being skipped that had a lower IP address than the
highest IP address of a peer belonging to a group.

As the ordering of peers can not be arbitrary due to SNMP requiring
increasing OIDs when walking an OID tree, this commit fixes the bug by
properly looping through all peers and detecting the next highest IP
address.

Additionally, this commit improved both bgp_peer_lookup_next and
peer_lookup_addr_ipv4 by using the socketunion stored within the peer
struct (peer->su) instead of calling inet_pton for each peer during
comparison.

Fixes #1190

Signed-off-by: Pascal Mathis mail@pascalmathis.com

@LabN-CI
Copy link
Collaborator

LabN-CI commented May 10, 2018

💚 Basic BGPD CI results: SUCCESS, 0 tests failed

Results table
_ _
Result SUCCESS git merge/2207 f271114
Date 05/10/2018
Start 17:45:13
Finish 18:08:37
Run-Time 23:24
Total 1813
Pass 1813
Fail 0
Valgrind-Errors 0
Valgrind-Loss 0
Details vncregress-2018-05-10-17:45:13.txt
Log autoscript-2018-05-10-17:46:06.log.bz2

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

This is a comment from an EXPERIMENTAL automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.


CLANG Static Analyzer Summary

  • Github Pull Request 2207, comparing to Git base SHA 3dc755e

No Changes in Static Analysis warnings compared to base

6 Static Analyzer issues remaining.

See details at
https://ci1.netdef.org/browse/FRR-FRRPULLREQ-3583/artifact/shared/static_analysis/index.html

Copy link

@stannous stannous left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I built and tested this and the results are good. Please remove the unused variables addr and ret in peer_lookup_addr_ipv4() and ret in bgp_peer_lookup_next().

The previous implementation of bgp_peer_lookup_next did not consider the
internal ordering of peers when using peer groups, which led to all
standalone peers being skipped that had a lower IP address than the
highest IP address of a peer belonging to a group.

As the ordering of peers can not be arbitrary due to SNMP requiring
increasing OIDs when walking an OID tree, this commit fixes the bug by
properly looping through all peers and detecting the next highest IP
address.

Additionally, this commit improved both bgp_peer_lookup_next and
peer_lookup_addr_ipv4 by using the socketunion stored within the peer
struct (peer->su) instead of calling inet_pton for each peer during
comparison.

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
@ppmathis
Copy link
Member Author

@stannous Thank you for your feedback, seems I forgot about cleaning up the variables after trying several variants/solutions. I have updated the PR accordingly.

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

This is a comment from an EXPERIMENTAL automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.


CLANG Static Analyzer Summary

  • Github Pull Request 2207, comparing to Git base SHA 3dc755e

No Changes in Static Analysis warnings compared to base

6 Static Analyzer issues remaining.

See details at
https://ci1.netdef.org/browse/FRR-FRRPULLREQ-3589/artifact/shared/static_analysis/index.html

@LabN-CI
Copy link
Collaborator

LabN-CI commented May 11, 2018

💚 Basic BGPD CI results: SUCCESS, 0 tests failed

Results table
_ _
Result SUCCESS git merge/2207 2b8e62f
Date 05/11/2018
Start 08:38:29
Finish 09:01:33
Run-Time 23:04
Total 1813
Pass 1813
Fail 0
Valgrind-Errors 0
Valgrind-Loss 0
Details vncregress-2018-05-11-08:38:29.txt
Log autoscript-2018-05-11-08:39:20.log.bz2

For details, please contact louberger

@donaldsharp donaldsharp merged commit 2c263b3 into FRRouting:master May 11, 2018
@ppmathis ppmathis deleted the fix/bgpd-snmp-peer-lookup branch May 12, 2018 17:01
f0o added a commit to FRRouting/gentoo-overlay that referenced this pull request May 14, 2018
f0o added a commit to FRRouting/gentoo-overlay that referenced this pull request May 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SNMP (Agentx) does not show all peers
5 participants