diff --git a/libi2pd/SSU.cpp b/libi2pd/SSU.cpp index bb4195f6..cd59b550 100644 --- a/libi2pd/SSU.cpp +++ b/libi2pd/SSU.cpp @@ -6,6 +6,10 @@ #include "NetDb.hpp" #include "SSU.h" +#ifndef WIN32 +#include +#endif + namespace i2p { namespace transport @@ -50,6 +54,11 @@ namespace transport m_SocketV6.set_option (boost::asio::ip::v6_only (true)); m_SocketV6.set_option (boost::asio::socket_base::receive_buffer_size (SSU_SOCKET_RECEIVE_BUFFER_SIZE)); m_SocketV6.set_option (boost::asio::socket_base::send_buffer_size (SSU_SOCKET_SEND_BUFFER_SIZE)); +#ifndef WIN32 + // Set preference to use public IPv6 address -- works only on linux + typedef boost::asio::detail::socket_option::boolean ipv6PreferPubAddr; + m_SocketV6.set_option (ipv6PreferPubAddr(true)); +#endif m_SocketV6.bind (m_EndpointV6); LogPrint (eLogInfo, "SSU: Start listening v6 port ", m_EndpointV6.port()); } catch ( std::exception & ex ) {