diff --git a/src/kademlia/dht_tracker.cpp b/src/kademlia/dht_tracker.cpp index 4de0cce55..8c9345577 100644 --- a/src/kademlia/dht_tracker.cpp +++ b/src/kademlia/dht_tracker.cpp @@ -268,8 +268,9 @@ namespace libtorrent { namespace dht void dht_tracker::rebind(asio::ip::address listen_interface, int listen_port) { m_socket.close(); - m_socket.open(asio::ip::udp::v4()); - m_socket.bind(udp::endpoint(listen_interface, listen_port)); + udp::endpoint ep(listen_interface, listen_port); + m_socket.open(ep.protocol()); + m_socket.bind(ep); } void dht_tracker::tick(asio::error_code const& e) diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index 3f50ca5d2..efa13d841 100755 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -2010,7 +2010,7 @@ namespace libtorrent m_queued = false; assert(m_connecting); - m_socket->open(asio::ip::tcp::v4()); + m_socket->open(t->get_interface().protocol()); m_socket->bind(t->get_interface()); if (m_remote_proxy != tcp::endpoint()) { diff --git a/src/session_impl.cpp b/src/session_impl.cpp index 65c0f25c9..5d6a95510 100755 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -616,7 +616,7 @@ namespace libtorrent { namespace detail { try { - m_listen_socket->open(asio::ip::tcp::v4()); + m_listen_socket->open(m_listen_interface.protocol()); m_listen_socket->bind(m_listen_interface); m_listen_socket->listen(); break;