-
Notifications
You must be signed in to change notification settings - Fork 770
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
Fix asymmetric whitelist matching [19035] #3733
Conversation
Compatibility report: compat_report.zip |
0d081a6
to
2e7b31d
Compare
@richiprosima please test this |
@Mergifyio backport 2.11.x 2.10.x 2.6.x |
✅ Backports have been created
|
@richiprosima please test mac |
@Mergifyio backport eprosima/integration |
✅ Backports have been created
|
@richiprosima Please test mac |
@richiprosima please test mac |
Signed-off-by: JesusPoderoso <[email protected]>
Signed-off-by: JesusPoderoso <[email protected]>
Signed-off-by: JesusPoderoso <[email protected]>
Signed-off-by: Juan López Fernández <[email protected]>
…tors refactor Signed-off-by: Juan López Fernández <[email protected]>
Signed-off-by: Juan Lopez Fernandez <[email protected]>
…peers and discovery server Signed-off-by: Juan Lopez Fernandez <[email protected]>
Signed-off-by: Juan Lopez Fernandez <[email protected]>
Signed-off-by: Juan Lopez Fernandez <[email protected]>
Signed-off-by: Eduardo Ponz <[email protected]>
95bbe33
2e7b31d
to
95bbe33
Compare
@richiprosima please test this |
…connect Signed-off-by: Juan Lopez Fernandez <[email protected]>
95bbe33
to
deefaf9
Compare
@richiprosima please test this |
Signed-off-by: Juan Lopez Fernandez <[email protected]>
4a0241f
to
c473fca
Compare
@richiprosima please test this |
1 similar comment
@richiprosima please test this |
* Refs #18854: Asymmetric whitelist regression test Signed-off-by: JesusPoderoso <[email protected]> * Refs #18854: Fix Windows build error Signed-off-by: JesusPoderoso <[email protected]> * Refs #18854: Apply rev suggestions Signed-off-by: JesusPoderoso <[email protected]> * Refs #19203: Add more test cases Signed-off-by: Juan López Fernández <[email protected]> * Refs #19203: Asymmetric whitelist matching fix: transform_remote_locators refactor Signed-off-by: Juan López Fernández <[email protected]> * Refs #19203: Tiny fixes Signed-off-by: Juan Lopez Fernandez <[email protected]> * Refs #19203: Add warnings for non-localhost local address in initial peers and discovery server Signed-off-by: Juan Lopez Fernandez <[email protected]> * Refs #19203: Bonus fix: TCPv6 + whitelist Signed-off-by: Juan Lopez Fernandez <[email protected]> * Refs #19203: Avoid API/ABI break Signed-off-by: Juan Lopez Fernandez <[email protected]> * Refs #19203: Fix TCP when no whitelist and initial peer != localhost Signed-off-by: Eduardo Ponz <[email protected]> * Refs #19203: Improve some comments Signed-off-by: Eduardo Ponz <[email protected]> * Refs #19203: Uncrustify Signed-off-by: Eduardo Ponz <[email protected]> * Refs #19203: Fix missing include Signed-off-by: Eduardo Ponz <[email protected]> * Refs #19203: Revert locator scope append in TCPChannelResourceBasic::connect Signed-off-by: Juan Lopez Fernandez <[email protected]> * Refs #19203: Disable (almost) all IPv6 tests Signed-off-by: Juan Lopez Fernandez <[email protected]> --------- Signed-off-by: JesusPoderoso <[email protected]> Signed-off-by: Juan López Fernández <[email protected]> Signed-off-by: Juan Lopez Fernandez <[email protected]> Signed-off-by: Eduardo Ponz <[email protected]> Co-authored-by: JesusPoderoso <[email protected]> Co-authored-by: Eduardo Ponz <[email protected]> (cherry picked from commit c8ab860)
* Refs #18854: Asymmetric whitelist regression test Signed-off-by: JesusPoderoso <[email protected]> * Refs #18854: Fix Windows build error Signed-off-by: JesusPoderoso <[email protected]> * Refs #18854: Apply rev suggestions Signed-off-by: JesusPoderoso <[email protected]> * Refs #19203: Add more test cases Signed-off-by: Juan López Fernández <[email protected]> * Refs #19203: Asymmetric whitelist matching fix: transform_remote_locators refactor Signed-off-by: Juan López Fernández <[email protected]> * Refs #19203: Tiny fixes Signed-off-by: Juan Lopez Fernandez <[email protected]> * Refs #19203: Add warnings for non-localhost local address in initial peers and discovery server Signed-off-by: Juan Lopez Fernandez <[email protected]> * Refs #19203: Bonus fix: TCPv6 + whitelist Signed-off-by: Juan Lopez Fernandez <[email protected]> * Refs #19203: Avoid API/ABI break Signed-off-by: Juan Lopez Fernandez <[email protected]> * Refs #19203: Fix TCP when no whitelist and initial peer != localhost Signed-off-by: Eduardo Ponz <[email protected]> * Refs #19203: Improve some comments Signed-off-by: Eduardo Ponz <[email protected]> * Refs #19203: Uncrustify Signed-off-by: Eduardo Ponz <[email protected]> * Refs #19203: Fix missing include Signed-off-by: Eduardo Ponz <[email protected]> * Refs #19203: Revert locator scope append in TCPChannelResourceBasic::connect Signed-off-by: Juan Lopez Fernandez <[email protected]> * Refs #19203: Disable (almost) all IPv6 tests Signed-off-by: Juan Lopez Fernandez <[email protected]> --------- Signed-off-by: JesusPoderoso <[email protected]> Signed-off-by: Juan López Fernández <[email protected]> Signed-off-by: Juan Lopez Fernandez <[email protected]> Signed-off-by: Eduardo Ponz <[email protected]> Co-authored-by: JesusPoderoso <[email protected]> Co-authored-by: Eduardo Ponz <[email protected]> (cherry picked from commit c8ab860)
* Refs #18854: Asymmetric whitelist regression test Signed-off-by: JesusPoderoso <[email protected]> * Refs #18854: Fix Windows build error Signed-off-by: JesusPoderoso <[email protected]> * Refs #18854: Apply rev suggestions Signed-off-by: JesusPoderoso <[email protected]> * Refs #19203: Add more test cases Signed-off-by: Juan López Fernández <[email protected]> * Refs #19203: Asymmetric whitelist matching fix: transform_remote_locators refactor Signed-off-by: Juan López Fernández <[email protected]> * Refs #19203: Tiny fixes Signed-off-by: Juan Lopez Fernandez <[email protected]> * Refs #19203: Add warnings for non-localhost local address in initial peers and discovery server Signed-off-by: Juan Lopez Fernandez <[email protected]> * Refs #19203: Bonus fix: TCPv6 + whitelist Signed-off-by: Juan Lopez Fernandez <[email protected]> * Refs #19203: Avoid API/ABI break Signed-off-by: Juan Lopez Fernandez <[email protected]> * Refs #19203: Fix TCP when no whitelist and initial peer != localhost Signed-off-by: Eduardo Ponz <[email protected]> * Refs #19203: Improve some comments Signed-off-by: Eduardo Ponz <[email protected]> * Refs #19203: Uncrustify Signed-off-by: Eduardo Ponz <[email protected]> * Refs #19203: Fix missing include Signed-off-by: Eduardo Ponz <[email protected]> * Refs #19203: Revert locator scope append in TCPChannelResourceBasic::connect Signed-off-by: Juan Lopez Fernandez <[email protected]> * Refs #19203: Disable (almost) all IPv6 tests Signed-off-by: Juan Lopez Fernandez <[email protected]> --------- Signed-off-by: JesusPoderoso <[email protected]> Signed-off-by: Juan López Fernández <[email protected]> Signed-off-by: Juan Lopez Fernandez <[email protected]> Signed-off-by: Eduardo Ponz <[email protected]> Co-authored-by: JesusPoderoso <[email protected]> Co-authored-by: Eduardo Ponz <[email protected]> (cherry picked from commit c8ab860) # Conflicts: # include/fastdds/rtps/attributes/RTPSParticipantAttributes.h # include/fastdds/rtps/transport/TransportInterface.h # src/cpp/rtps/transport/TCPTransportInterface.cpp # test/mock/rtps/NetworkFactory/fastdds/rtps/network/NetworkFactory.h
* Refs #18854: Asymmetric whitelist regression test Signed-off-by: JesusPoderoso <[email protected]> * Refs #18854: Fix Windows build error Signed-off-by: JesusPoderoso <[email protected]> * Refs #18854: Apply rev suggestions Signed-off-by: JesusPoderoso <[email protected]> * Refs #19203: Add more test cases Signed-off-by: Juan López Fernández <[email protected]> * Refs #19203: Asymmetric whitelist matching fix: transform_remote_locators refactor Signed-off-by: Juan López Fernández <[email protected]> * Refs #19203: Tiny fixes Signed-off-by: Juan Lopez Fernandez <[email protected]> * Refs #19203: Add warnings for non-localhost local address in initial peers and discovery server Signed-off-by: Juan Lopez Fernandez <[email protected]> * Refs #19203: Bonus fix: TCPv6 + whitelist Signed-off-by: Juan Lopez Fernandez <[email protected]> * Refs #19203: Avoid API/ABI break Signed-off-by: Juan Lopez Fernandez <[email protected]> * Refs #19203: Fix TCP when no whitelist and initial peer != localhost Signed-off-by: Eduardo Ponz <[email protected]> * Refs #19203: Improve some comments Signed-off-by: Eduardo Ponz <[email protected]> * Refs #19203: Uncrustify Signed-off-by: Eduardo Ponz <[email protected]> * Refs #19203: Fix missing include Signed-off-by: Eduardo Ponz <[email protected]> * Refs #19203: Revert locator scope append in TCPChannelResourceBasic::connect Signed-off-by: Juan Lopez Fernandez <[email protected]> * Refs #19203: Disable (almost) all IPv6 tests Signed-off-by: Juan Lopez Fernandez <[email protected]> --------- Signed-off-by: JesusPoderoso <[email protected]> Signed-off-by: Juan López Fernández <[email protected]> Signed-off-by: Juan Lopez Fernandez <[email protected]> Signed-off-by: Eduardo Ponz <[email protected]> Co-authored-by: JesusPoderoso <[email protected]> Co-authored-by: Eduardo Ponz <[email protected]> (cherry picked from commit c8ab860) # Conflicts: # include/fastdds/rtps/transport/TransportInterface.h # test/mock/rtps/NetworkFactory/fastdds/rtps/network/NetworkFactory.h
Description
Matching two local participants through UDP/TCP transport currently fails when only one of them sets an interface whitelist. In particular, the problematic cases are only including the loopback interface (A), or including all except the loopback interface (B).
The reason for this is that Fast DDS internally performs an optimization consisting in transforming a local locator to localhost (
NetworkFactory::transform_remote_locators
) whenever possible. This way, communication is performed through the loopback interface, which is allegedly more robust to changes in the environment.However, the only input for determining whether this transformation should be performed is each transport's own interface whitelist. This implies that in some cases the transformation will be wrongly performed as the remote transport may not be listening on localhost (B).
Another issue with this transformation method is that it boths attempts conversion to localhost as well as filters locators based on one's interface whitelist. This explains why A arises, as the received remote (local) locator gets filtered out for being different than localhost.
This PR attempts to fix the issue by sending in discovery a new network configuration parameter, which for the moment only includes whether a participant is listening on localhost (depending on its whitelist). Four (plus 28 unused) different bits encoding this information are sent, each for a different transport kind (UDPv4, UDPv6, TCPv4 and TCPv6).
An extended
NetworkFactory::transform_remote_locators
is added leveraging this information, so conversion to localhost is only performed when both remote and local participants allow for it.Behaviour changes:
@Mergifyio backport 2.11.x 2.10.x 2.6.x
Contributor Checklist
versions.md
file (if applicable).Reviewer Checklist