Fix setting ipv6 interface

This commit is contained in:
airium 2018-11-15 01:55:49 +08:00 committed by Arvid Norberg
parent e5dfcfc6b8
commit 9415467dd8
1 changed files with 1 additions and 1 deletions

View File

@ -2055,7 +2055,7 @@ retry:
// used to send to the tracker // used to send to the tracker
std::vector<ip_interface> ifs = enum_net_interfaces(m_io_service, ec); std::vector<ip_interface> ifs = enum_net_interfaces(m_io_service, ec);
for (std::vector<ip_interface>::const_iterator i = ifs.begin() for (std::vector<ip_interface>::const_iterator i = ifs.begin()
, end(ifs.end()); i != end && (want_v4 && want_v6); ++i) , end(ifs.end()); i != end && (want_v4 || want_v6); ++i)
{ {
address const& addr = i->interface_address; address const& addr = i->interface_address;
if (want_v4 && addr.is_v4() && !is_local(addr) && !is_loopback(addr)) if (want_v4 && addr.is_v4() && !is_local(addr) && !is_loopback(addr))