merged minor IPv6 fix from libtorrent_aio
This commit is contained in:
parent
73a7e9f03b
commit
fae3d23e27
|
@ -66,7 +66,10 @@ namespace libtorrent
|
||||||
{
|
{
|
||||||
TORRENT_TRY {
|
TORRENT_TRY {
|
||||||
#if TORRENT_USE_IPV6
|
#if TORRENT_USE_IPV6
|
||||||
if (a.is_v6()) return a.to_v6().is_link_local();
|
if (a.is_v6())
|
||||||
|
{
|
||||||
|
return a.to_v6() == address_v6::loopback();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
address_v4 a4 = a.to_v4();
|
address_v4 a4 = a.to_v4();
|
||||||
unsigned long ip = a4.to_ulong();
|
unsigned long ip = a4.to_ulong();
|
||||||
|
|
|
@ -1360,6 +1360,14 @@ namespace libtorrent
|
||||||
if (remote.address() == address() || remote.port() == 0)
|
if (remote.address() == address() || remote.port() == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
#if TORRENT_USE_IPV6
|
||||||
|
// don't allow link-local IPv6 addresses since they
|
||||||
|
// can't be used like normal addresses, they require an interface
|
||||||
|
// and will just cause connect() to fail with EINVAL
|
||||||
|
if (remote.address().is_v6() && remote.address().to_v6().is_link_local())
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
aux::session_impl& ses = m_torrent->session();
|
aux::session_impl& ses = m_torrent->session();
|
||||||
|
|
||||||
// if this is an i2p torrent, and we don't allow mixed mode
|
// if this is an i2p torrent, and we don't allow mixed mode
|
||||||
|
|
Loading…
Reference in New Issue