fixed bug where broadcast socket would not send messages on interfaces with addresses in local network ranges
This commit is contained in:
parent
f0cd0c152c
commit
f0f285ae63
|
@ -169,15 +169,13 @@ namespace libtorrent
|
|||
for (std::vector<ip_interface>::const_iterator i = interfaces.begin()
|
||||
, 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
|
||||
if (i->interface_address.is_v4() != multicast_endpoint.address().is_v4()) continue;
|
||||
// ignore any loopback interface
|
||||
if (is_loopback(i->interface_address)) continue;
|
||||
|
||||
#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;
|
||||
#endif
|
||||
open_unicast_socket(ios, i->interface_address);
|
||||
|
|
Loading…
Reference in New Issue