diff --git a/src/cpp/rtps/transport/TCPTransportInterface.cpp b/src/cpp/rtps/transport/TCPTransportInterface.cpp index c5f53a16d0a..a1de14700b5 100644 --- a/src/cpp/rtps/transport/TCPTransportInterface.cpp +++ b/src/cpp/rtps/transport/TCPTransportInterface.cpp @@ -772,9 +772,9 @@ bool TCPTransportInterface::OpenOutputChannel( std::vector list; std::vector local_interfaces; get_ips(local_interfaces); - for (const auto& interface : local_interfaces) + for (const auto& interface_it : local_interfaces) { - Locator interface_loc(interface.locator); + Locator interface_loc(interface_it.locator); interface_loc.port = physical_locator.port; if (is_interface_allowed(interface_loc)) {