fix for systems where IPv6 sockets bound to INADDR_ANY also listens on IPv4 connections
This commit is contained in:
@@ -473,7 +473,7 @@ namespace libtorrent
|
||||
// we might need more than one listen socket
|
||||
std::list<listen_socket_t> m_listen_sockets;
|
||||
|
||||
listen_socket_t setup_listener(tcp::endpoint ep, int retries);
|
||||
listen_socket_t setup_listener(tcp::endpoint ep, int retries, bool v6_only = false);
|
||||
|
||||
// the settings for the client
|
||||
session_settings m_settings;
|
||||
|
@@ -171,6 +171,21 @@ namespace libtorrent
|
||||
return Endpoint(addr, port);
|
||||
}
|
||||
}
|
||||
|
||||
struct v6only
|
||||
{
|
||||
v6only(bool enable): m_value(enable) {}
|
||||
template<class Protocol>
|
||||
int level(Protocol const&) const { return IPPROTO_IPV6; }
|
||||
template<class Protocol>
|
||||
int name(Protocol const&) const { return IPV6_V6ONLY; }
|
||||
template<class Protocol>
|
||||
int const* data(Protocol const&) const { return &m_value; }
|
||||
template<class Protocol>
|
||||
size_t size(Protocol const&) const { return sizeof(m_value); }
|
||||
int m_value;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // TORRENT_SOCKET_HPP_INCLUDED
|
||||
|
Reference in New Issue
Block a user