Skip to content

Commit

Permalink
Refs #20238: Adding interface to locator if whitelist is not empty
Browse files Browse the repository at this point in the history
Signed-off-by: cferreiragonz <[email protected]>
  • Loading branch information
cferreiragonz committed Feb 19, 2024
1 parent d64a9da commit 6e523a2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/cpp/rtps/transport/TCPTransportInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ void TCPTransportInterface::calculate_crc(
}

uint16_t TCPTransportInterface::create_acceptor_socket(
const Locator& locator)
Locator& locator)
{
uint16_t final_port = 0;
try
Expand Down Expand Up @@ -348,6 +348,14 @@ uint16_t TCPTransportInterface::create_acceptor_socket(
std::vector<std::string> vInterfaces = get_binding_interfaces_list();
for (std::string& sInterface : vInterfaces)
{
if (locator.kind == LOCATOR_KIND_TCPv4)
{
IPLocator::setIPv4(locator, sInterface);
}
else if (locator.kind == LOCATOR_KIND_TCPv6)
{
IPLocator::setIPv6(locator, sInterface);
}
#if TLS_FOUND
if (configuration()->apply_security)
{
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/rtps/transport/TCPTransportInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class TCPTransportInterface : public TransportInterface

//! Creates a TCP acceptor to wait for incoming connections by the given locator.
uint16_t create_acceptor_socket(
const Locator& locator);
Locator& locator);

virtual void get_ips(
std::vector<fastrtps::rtps::IPFinder::info_IP>& loc_names,
Expand Down

0 comments on commit 6e523a2

Please sign in to comment.