Fix asymmetric whitelist matching [19035]#3733
Merged
Conversation
Contributor
Author
|
Compatibility report: compat_report.zip |
0d081a6 to
2e7b31d
Compare
|
@richiprosima please test this |
|
@Mergifyio backport 2.11.x 2.10.x 2.6.x |
Contributor
✅ Backports have been createdDetails
|
EduPonz
previously approved these changes
Aug 10, 2023
|
@richiprosima please test mac |
Contributor
|
@Mergifyio backport eprosima/integration |
Contributor
✅ Backports have been createdDetails
|
MiguelCompany
previously approved these changes
Aug 29, 2023
Member
|
@richiprosima Please test mac |
Contributor
|
@richiprosima please test mac |
Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com>
Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com>
Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com>
Signed-off-by: Juan López Fernández <juanlopez@eprosima.com>
…tors refactor Signed-off-by: Juan López Fernández <juanlopez@eprosima.com>
Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com>
…peers and discovery server Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com>
Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com>
Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com>
Contributor
Author
|
@richiprosima please test this |
…connect Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com>
95bbe33 to
deefaf9
Compare
Contributor
Author
|
@richiprosima please test this |
Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com>
4a0241f to
c473fca
Compare
Contributor
Author
|
@richiprosima please test this |
1 similar comment
Contributor
Author
|
@richiprosima please test this |
EduPonz
approved these changes
Sep 21, 2023
mergify bot
pushed a commit
that referenced
this pull request
Sep 21, 2023
* Refs #18854: Asymmetric whitelist regression test Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com> * Refs #18854: Fix Windows build error Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com> * Refs #18854: Apply rev suggestions Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com> * Refs #19203: Add more test cases Signed-off-by: Juan López Fernández <juanlopez@eprosima.com> * Refs #19203: Asymmetric whitelist matching fix: transform_remote_locators refactor Signed-off-by: Juan López Fernández <juanlopez@eprosima.com> * Refs #19203: Tiny fixes Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com> * Refs #19203: Add warnings for non-localhost local address in initial peers and discovery server Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com> * Refs #19203: Bonus fix: TCPv6 + whitelist Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com> * Refs #19203: Avoid API/ABI break Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com> * Refs #19203: Fix TCP when no whitelist and initial peer != localhost Signed-off-by: Eduardo Ponz <eduardoponz@eprosima.com> * Refs #19203: Improve some comments Signed-off-by: Eduardo Ponz <eduardoponz@eprosima.com> * Refs #19203: Uncrustify Signed-off-by: Eduardo Ponz <eduardoponz@eprosima.com> * Refs #19203: Fix missing include Signed-off-by: Eduardo Ponz <eduardoponz@eprosima.com> * Refs #19203: Revert locator scope append in TCPChannelResourceBasic::connect Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com> * Refs #19203: Disable (almost) all IPv6 tests Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com> --------- Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com> Signed-off-by: Juan López Fernández <juanlopez@eprosima.com> Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com> Signed-off-by: Eduardo Ponz <eduardoponz@eprosima.com> Co-authored-by: JesusPoderoso <jesuspoderoso@eprosima.com> Co-authored-by: Eduardo Ponz <eduardoponz@eprosima.com> (cherry picked from commit c8ab860)
mergify bot
pushed a commit
that referenced
this pull request
Sep 21, 2023
* Refs #18854: Asymmetric whitelist regression test Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com> * Refs #18854: Fix Windows build error Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com> * Refs #18854: Apply rev suggestions Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com> * Refs #19203: Add more test cases Signed-off-by: Juan López Fernández <juanlopez@eprosima.com> * Refs #19203: Asymmetric whitelist matching fix: transform_remote_locators refactor Signed-off-by: Juan López Fernández <juanlopez@eprosima.com> * Refs #19203: Tiny fixes Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com> * Refs #19203: Add warnings for non-localhost local address in initial peers and discovery server Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com> * Refs #19203: Bonus fix: TCPv6 + whitelist Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com> * Refs #19203: Avoid API/ABI break Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com> * Refs #19203: Fix TCP when no whitelist and initial peer != localhost Signed-off-by: Eduardo Ponz <eduardoponz@eprosima.com> * Refs #19203: Improve some comments Signed-off-by: Eduardo Ponz <eduardoponz@eprosima.com> * Refs #19203: Uncrustify Signed-off-by: Eduardo Ponz <eduardoponz@eprosima.com> * Refs #19203: Fix missing include Signed-off-by: Eduardo Ponz <eduardoponz@eprosima.com> * Refs #19203: Revert locator scope append in TCPChannelResourceBasic::connect Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com> * Refs #19203: Disable (almost) all IPv6 tests Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com> --------- Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com> Signed-off-by: Juan López Fernández <juanlopez@eprosima.com> Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com> Signed-off-by: Eduardo Ponz <eduardoponz@eprosima.com> Co-authored-by: JesusPoderoso <jesuspoderoso@eprosima.com> Co-authored-by: Eduardo Ponz <eduardoponz@eprosima.com> (cherry picked from commit c8ab860)
This was referenced Sep 21, 2023
mergify bot
pushed a commit
that referenced
this pull request
Sep 21, 2023
* Refs #18854: Asymmetric whitelist regression test Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com> * Refs #18854: Fix Windows build error Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com> * Refs #18854: Apply rev suggestions Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com> * Refs #19203: Add more test cases Signed-off-by: Juan López Fernández <juanlopez@eprosima.com> * Refs #19203: Asymmetric whitelist matching fix: transform_remote_locators refactor Signed-off-by: Juan López Fernández <juanlopez@eprosima.com> * Refs #19203: Tiny fixes Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com> * Refs #19203: Add warnings for non-localhost local address in initial peers and discovery server Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com> * Refs #19203: Bonus fix: TCPv6 + whitelist Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com> * Refs #19203: Avoid API/ABI break Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com> * Refs #19203: Fix TCP when no whitelist and initial peer != localhost Signed-off-by: Eduardo Ponz <eduardoponz@eprosima.com> * Refs #19203: Improve some comments Signed-off-by: Eduardo Ponz <eduardoponz@eprosima.com> * Refs #19203: Uncrustify Signed-off-by: Eduardo Ponz <eduardoponz@eprosima.com> * Refs #19203: Fix missing include Signed-off-by: Eduardo Ponz <eduardoponz@eprosima.com> * Refs #19203: Revert locator scope append in TCPChannelResourceBasic::connect Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com> * Refs #19203: Disable (almost) all IPv6 tests Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com> --------- Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com> Signed-off-by: Juan López Fernández <juanlopez@eprosima.com> Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com> Signed-off-by: Eduardo Ponz <eduardoponz@eprosima.com> Co-authored-by: JesusPoderoso <jesuspoderoso@eprosima.com> Co-authored-by: Eduardo Ponz <eduardoponz@eprosima.com> (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
mergify bot
pushed a commit
that referenced
this pull request
Sep 21, 2023
* Refs #18854: Asymmetric whitelist regression test Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com> * Refs #18854: Fix Windows build error Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com> * Refs #18854: Apply rev suggestions Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com> * Refs #19203: Add more test cases Signed-off-by: Juan López Fernández <juanlopez@eprosima.com> * Refs #19203: Asymmetric whitelist matching fix: transform_remote_locators refactor Signed-off-by: Juan López Fernández <juanlopez@eprosima.com> * Refs #19203: Tiny fixes Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com> * Refs #19203: Add warnings for non-localhost local address in initial peers and discovery server Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com> * Refs #19203: Bonus fix: TCPv6 + whitelist Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com> * Refs #19203: Avoid API/ABI break Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com> * Refs #19203: Fix TCP when no whitelist and initial peer != localhost Signed-off-by: Eduardo Ponz <eduardoponz@eprosima.com> * Refs #19203: Improve some comments Signed-off-by: Eduardo Ponz <eduardoponz@eprosima.com> * Refs #19203: Uncrustify Signed-off-by: Eduardo Ponz <eduardoponz@eprosima.com> * Refs #19203: Fix missing include Signed-off-by: Eduardo Ponz <eduardoponz@eprosima.com> * Refs #19203: Revert locator scope append in TCPChannelResourceBasic::connect Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com> * Refs #19203: Disable (almost) all IPv6 tests Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com> --------- Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com> Signed-off-by: Juan López Fernández <juanlopez@eprosima.com> Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com> Signed-off-by: Eduardo Ponz <eduardoponz@eprosima.com> Co-authored-by: JesusPoderoso <jesuspoderoso@eprosima.com> Co-authored-by: Eduardo Ponz <eduardoponz@eprosima.com> (cherry picked from commit c8ab860) # Conflicts: # include/fastdds/rtps/transport/TransportInterface.h # test/mock/rtps/NetworkFactory/fastdds/rtps/network/NetworkFactory.h
10 tasks
11 tasks
12 tasks
This was referenced Jun 11, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_locatorsis 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.mdfile (if applicable).Reviewer Checklist