mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2026-08-28 03:04:30 +00:00
allow ipv6 binding for Haiku because IPV6_V6ONLY has been implemented since R1/Beta6
This commit is contained in:
+1
-5
@@ -985,7 +985,7 @@ namespace transport
|
||||
return;
|
||||
}
|
||||
auto size = bufbe16toh (buf->data () + 1);
|
||||
if (size + 3 > buf->size () || size > i2p::data::MAX_RI_BUFFER_SIZE + 1)
|
||||
if (size + 3 > (int)buf->size () || size > i2p::data::MAX_RI_BUFFER_SIZE + 1)
|
||||
{
|
||||
LogPrint (eLogError, "NTCP2: Unexpected RouterInfo size ", size, " in SessionConfirmed");
|
||||
boost::asio::post (m_Server.GetService (), std::bind (&NTCP2Session::Terminate, shared_from_this ()));
|
||||
@@ -1784,10 +1784,6 @@ namespace transport
|
||||
}
|
||||
else if (address->IsV6() && (context.SupportsV6 () || context.SupportsMesh ()))
|
||||
{
|
||||
#if defined(__HAIKU__)
|
||||
LogPrint (eLogInfo, "NTCP2: Can't listen v6 TCP port ", address->port, ". IPV6_V6ONLY is not supported");
|
||||
continue; // IPV6_V6ONLY is not supported. Don't listen ipv6
|
||||
#endif
|
||||
m_NTCP2V6Acceptor.reset (new boost::asio::ip::tcp::acceptor (GetService ()));
|
||||
try
|
||||
{
|
||||
|
||||
@@ -289,14 +289,7 @@ namespace transport
|
||||
socket.close ();
|
||||
socket.open (localEndpoint.protocol ());
|
||||
if (localEndpoint.address ().is_v6 ())
|
||||
#if !defined(__HAIKU__)
|
||||
socket.set_option (boost::asio::ip::v6_only (true));
|
||||
#else
|
||||
{
|
||||
LogPrint (eLogWarning, "SSU2: Socket option IPV6_V6ONLY is not supported");
|
||||
m_IsForcedFirewalled6 = true; // IPV6_V6ONLY is not supported, always Firewalled for ipv6
|
||||
}
|
||||
#endif
|
||||
|
||||
uint64_t bufferSize = i2p::context.GetBandwidthLimit() * 1024 / 5; // max lag = 200ms
|
||||
bufferSize = std::max(SSU2_SOCKET_MIN_BUFFER_SIZE, std::min(bufferSize, SSU2_SOCKET_MAX_BUFFER_SIZE));
|
||||
|
||||
Reference in New Issue
Block a user