fixed bug where broadcast socket would not send messages on interfaces with addresses in local network ranges
This commit is contained in:
@@ -169,15 +169,13 @@ namespace libtorrent
|
|||||||
for (std::vector<ip_interface>::const_iterator i = interfaces.begin()
|
for (std::vector<ip_interface>::const_iterator i = interfaces.begin()
|
||||||
, end(interfaces.end()); i != end; ++i)
|
, end(interfaces.end()); i != end; ++i)
|
||||||
{
|
{
|
||||||
// only broadcast to IPv4 addresses that are not local
|
|
||||||
if (is_local(i->interface_address)) continue;
|
|
||||||
// only multicast on compatible networks
|
// only multicast on compatible networks
|
||||||
if (i->interface_address.is_v4() != multicast_endpoint.address().is_v4()) continue;
|
if (i->interface_address.is_v4() != multicast_endpoint.address().is_v4()) continue;
|
||||||
// ignore any loopback interface
|
// ignore any loopback interface
|
||||||
if (is_loopback(i->interface_address)) continue;
|
if (is_loopback(i->interface_address)) continue;
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
// std::cerr << "broadcast socket [ if: " << i->to_v4().to_string()
|
// std::cerr << "broadcast socket [ if: " << i->interface_address.to_v4().to_string()
|
||||||
// << " group: " << multicast_endpoint.address() << " ]" << std::endl;
|
// << " group: " << multicast_endpoint.address() << " ]" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
open_unicast_socket(ios, i->interface_address);
|
open_unicast_socket(ios, i->interface_address);
|
||||||
|
Reference in New Issue
Block a user