mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-27 11:17:49 +02:00
#1251 - prefer public ipv6 address instead of temporary (test)
This commit is contained in:
parent
2abc9807d9
commit
754299339d
1 changed files with 9 additions and 0 deletions
|
@ -6,6 +6,10 @@
|
|||
#include "NetDb.hpp"
|
||||
#include "SSU.h"
|
||||
|
||||
#ifndef WIN32
|
||||
#include <linux/in6.h>
|
||||
#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<IPV6_ADDR_PREFERENCES, IPV6_PREFER_SRC_PUBLIC> 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 ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue