Skip to content

Commit

Permalink
Allow RtpsRelay Clients With Multiple IP Addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
iguessthislldo committed Jul 2, 2024
1 parent db05e56 commit 80dc3bd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 5 additions & 0 deletions docs/news.d/relay-multi-ip.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.. news-prs: 4718
.. news-start-section: Fixes
- RtpsRelay: Recognize clients that are using different IP addresses for SPDP and SEDP.
.. news-end-section
4 changes: 2 additions & 2 deletions tools/rtpsrelay/GuidAddrSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ bool GuidAddrSet::ignore_rtps(bool from_application_participant,
pos->second.allow_rtps = true;

if (config_.log_activity()) {
ACE_DEBUG((LM_INFO, ACE_TEXT("(%P|%t) INFO: GuidAddrSet::record_activity ")
ACE_DEBUG((LM_INFO, ACE_TEXT("(%P|%t) INFO: GuidAddrSet::ignore_rtps ")
ACE_TEXT("%C was admitted %C into session\n"),
guid_to_string(guid).c_str(),
pos->second.get_session_time(now).sec_str().c_str()));
Expand Down Expand Up @@ -246,7 +246,7 @@ bool GuidAddrSet::ignore_rtps(bool from_application_participant,
admitted = true;

if (config_.log_activity()) {
ACE_DEBUG((LM_INFO, ACE_TEXT("(%P|%t) INFO: GuidAddrSet::record_activity ")
ACE_DEBUG((LM_INFO, ACE_TEXT("(%P|%t) INFO: GuidAddrSet::ignore_rtps ")
ACE_TEXT("%C was admitted %C into session\n"),
guid_to_string(guid).c_str(),
pos->second.get_session_time(now).sec_str().c_str()));
Expand Down
6 changes: 5 additions & 1 deletion tools/rtpsrelay/GuidAddrSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,12 @@ struct AddrSetStats {

bool has_discovery_addrs() const
{
bool spdp = false;
bool sedp = false;
for (const auto& ip : ip_to_ports) {
if (!ip.second.spdp_ports.empty() && !ip.second.sedp_ports.empty()) {
spdp = spdp || !ip.second.spdp_ports.empty();
sedp = sedp || !ip.second.sedp_ports.empty();
if (spdp && sedp) {
return true;
}
}
Expand Down

0 comments on commit 80dc3bd

Please sign in to comment.