diff --git a/libi2pd/NetDb.cpp b/libi2pd/NetDb.cpp index ccc43d7a..55e17b23 100644 --- a/libi2pd/NetDb.cpp +++ b/libi2pd/NetDb.cpp @@ -759,7 +759,8 @@ namespace data void NetDb::RequestDestination (const IdentHash& destination, RequestedDestination::RequestComplete requestComplete, bool direct) { - if (direct && i2p::transport::transports.RoutesRestricted ()) direct = false; // always use tunnels for restricted routes + if (direct && (i2p::transport::transports.RoutesRestricted () || i2p::context.IsLimitedConnectivity ())) + direct = false; // always use tunnels for restricted routes or limited connectivity if (m_Requests) m_Requests->PostRequestDestination (destination, requestComplete, direct); else diff --git a/libi2pd/RouterContext.h b/libi2pd/RouterContext.h index 09c3678f..03f1d10d 100644 --- a/libi2pd/RouterContext.h +++ b/libi2pd/RouterContext.h @@ -177,6 +177,7 @@ namespace garlic void SetMTU (int mtu, bool v4); void SetHidden(bool hide) { m_IsHiddenMode = hide; }; bool IsHidden() const { return m_IsHiddenMode; }; + bool IsLimitedConnectivity () const { return m_Status == eRouterStatusProxy; }; // TODO: implement other cases i2p::crypto::NoiseSymmetricState& GetCurrentNoiseState () { return m_CurrentNoiseState; }; void UpdateNTCP2V6Address (const boost::asio::ip::address& host); // called from Daemon. TODO: remove diff --git a/libi2pd/Transports.cpp b/libi2pd/Transports.cpp index cf30b428..549efb63 100644 --- a/libi2pd/Transports.cpp +++ b/libi2pd/Transports.cpp @@ -599,7 +599,7 @@ namespace transport } LogPrint (eLogInfo, "Transports: No compatible addresses available"); - if (peer->router->IsReachableFrom (i2p::context.GetRouterInfo ())) + if (!i2p::context.IsLimitedConnectivity () && peer->router->IsReachableFrom (i2p::context.GetRouterInfo ())) i2p::data::netdb.SetUnreachable (ident, true); // we are here because all connection attempts failed but router claimed them peer->Done (); std::unique_lock l(m_PeersMutex);