Browse Source

use ipv6 preference only when netinet headers not used (entware with musl workaround)'

Signed-off-by: R4SAS <r4sas@i2pmail.org>
pull/1752/head
R4SAS 3 years ago
parent
commit
1326597226
  1. 4
      libi2pd/NTCP2.cpp
  2. 4
      libi2pd/SSU.cpp

4
libi2pd/NTCP2.cpp

@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
#include "HTTP.h"
#include "util.h"
#ifdef __linux__
#if defined(__linux__) && !defined(_NETINET_IN_H)
#include <linux/in6.h>
#endif
@ -1243,7 +1243,7 @@ namespace transport @@ -1243,7 +1243,7 @@ namespace transport
m_NTCP2V6Acceptor->open (boost::asio::ip::tcp::v6());
m_NTCP2V6Acceptor->set_option (boost::asio::ip::v6_only (true));
m_NTCP2V6Acceptor->set_option (boost::asio::socket_base::reuse_address (true));
#ifdef __linux__
#if defined(__linux__) && !defined(_NETINET_IN_H)
if (!m_Address6 && !m_YggdrasilAddress) // only if not binded to address
{
// Set preference to use public IPv6 address -- tested on linux, not works on windows, and not tested on others

4
libi2pd/SSU.cpp

@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
#include "util.h"
#include "SSU.h"
#ifdef __linux__
#if defined(__linux__) && !defined(_NETINET_IN_H)
#include <linux/in6.h>
#endif
@ -68,7 +68,7 @@ namespace transport @@ -68,7 +68,7 @@ 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));
#ifdef __linux__
#if defined(__linux__) && !defined(_NETINET_IN_H)
if (m_EndpointV6.address() == boost::asio::ip::address().from_string("::")) // only if not binded to address
{
// Set preference to use public IPv6 address -- tested on linux, not works on windows, and not tested on others

Loading…
Cancel
Save