diff --git a/src/cpp/rtps/transport/TCPTransportInterface.cpp b/src/cpp/rtps/transport/TCPTransportInterface.cpp index 8a4547176f0..9bafa93bcde 100644 --- a/src/cpp/rtps/transport/TCPTransportInterface.cpp +++ b/src/cpp/rtps/transport/TCPTransportInterface.cpp @@ -760,10 +760,10 @@ bool TCPTransportInterface::OpenOutputChannel( if (!initial_peers_.empty()) { if (std::find(initial_peers_.begin(), initial_peers_.end(), - physical_locator) == initial_peers_.end()) + physical_locator) == initial_peers_.end()) { // Maybe as WAN? - if(IPLocator::hasWan(physical_locator) && (std::find(initial_peers_.begin(), initial_peers_.end(), + if (IPLocator::hasWan(physical_locator) && (std::find(initial_peers_.begin(), initial_peers_.end(), IPLocator::WanToLanLocator(physical_locator)) == initial_peers_.end())) { // Locator not found in initial peers list. diff --git a/test/blackbox/common/BlackboxTestsTransportTCP.cpp b/test/blackbox/common/BlackboxTestsTransportTCP.cpp index e73c57ebf36..f260f49d638 100644 --- a/test/blackbox/common/BlackboxTestsTransportTCP.cpp +++ b/test/blackbox/common/BlackboxTestsTransportTCP.cpp @@ -910,12 +910,12 @@ TEST(TransportTCP, TCPv4_multiple_listening_ports) client->disable_builtin_transport().add_user_transport_to_pparams(client_transport); Locator_t initialPeerLocator; initialPeerLocator.kind = LOCATOR_KIND_TCPv4; - IPLocator::setIPv4(initialPeerLocator, 127,0,0,1); + IPLocator::setIPv4(initialPeerLocator, 127, 0, 0, 1); initialPeerLocator.port = server_port_used; LocatorList_t initial_peer_list; initial_peer_list.push_back(initialPeerLocator); client->initial_peers(initial_peer_list); - client->init(); + client->init(); ASSERT_TRUE(client->isInitialized()); // Wait for discovery. OpenOutputChannel() is called. @@ -979,7 +979,7 @@ TEST(TransportTCP, TCPv6_multiple_listening_ports) LocatorList_t initial_peer_list; initial_peer_list.push_back(initialPeerLocator); client->initial_peers(initial_peer_list); - client->init(); + client->init(); ASSERT_TRUE(client->isInitialized()); // Wait for discovery. OpenOutputChannel() is called.