From 2bbe1e1c9174062f2c76f646cdffe9afb0253126 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Gonz=C3=A1lez=20Moreno?= Date: Wed, 30 Jan 2019 16:22:19 +0100 Subject: [PATCH 1/2] Fixed error sending multicast on Windows in only one interface. --- src/cpp/transport/UDPTransportInterface.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/cpp/transport/UDPTransportInterface.cpp b/src/cpp/transport/UDPTransportInterface.cpp index fa96c2d9b31..0ddf3ead38a 100644 --- a/src/cpp/transport/UDPTransportInterface.cpp +++ b/src/cpp/transport/UDPTransportInterface.cpp @@ -276,13 +276,16 @@ bool UDPTransportInterface::OpenAndBindOutputSockets(const Locator_t& locator) eProsimaUDPSocket unicastSocket = OpenAndBindUnicastOutputSocket(GenerateAnyAddressEndpoint(port), port); getSocketPtr(unicastSocket)->set_option(ip::multicast::enable_loopback(true)); + // Outbounding first interface with already created socket. + if(!locNames.empty()) + { + SetSocketOutbountInterface(unicastSocket, (*locNames.begin()).name); + } + // If more than one interface, then create sockets for outbounding multicast. if (locNames.size() > 1) { auto locIt = locNames.begin(); - - // Outbounding first interface with already created socket. - SetSocketOutbountInterface(unicastSocket, (*locIt).name); mOutputSockets.push_back(new UDPChannelResource(unicastSocket)); // Create other socket for outbounding rest of interfaces. From 898631920fd7f24fb2e77a6f2b73270b1da64678 Mon Sep 17 00:00:00 2001 From: Miguel Barro Otero Date: Thu, 31 Jan 2019 11:44:01 +0100 Subject: [PATCH 2/2] Fixed filtering interfaces mechanism on Windows --- src/cpp/utils/IPFinder.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cpp/utils/IPFinder.cpp b/src/cpp/utils/IPFinder.cpp index f792a679e28..23cfe4ca928 100644 --- a/src/cpp/utils/IPFinder.cpp +++ b/src/cpp/utils/IPFinder.cpp @@ -90,6 +90,7 @@ bool IPFinder::getIPs(std::vector* vec_name, bool return_loopback) info_IP info; info.type = family == AF_INET ? IP4 : IP6; info.name = std::string(buf); + info.dev = std::string(aa->AdapterName); // Currently not supported interfaces that not support multicast. if(aa->Flags & 0x0010)