Browse Source

require ipv4 for IBGW

pull/1656/head
orignal 3 years ago
parent
commit
2783337284
  1. 7
      libi2pd/TunnelPool.cpp

7
libi2pd/TunnelPool.cpp

@ -422,7 +422,7 @@ namespace tunnel @@ -422,7 +422,7 @@ namespace tunnel
{
auto r = i2p::transport::transports.GetRandomPeer ();
if (r && !r->GetProfile ()->IsBad () &&
(numHops > 1 || (!inbound && r->IsV4 ()) || r->IsReachable ())) // first inbound must be reachable
(numHops > 1 || (r->IsV4 () && (!inbound || r->IsReachable ())))) // first inbound must be reachable
{
prevHop = r;
peers.push_back (r->GetRouterIdentity ());
@ -443,9 +443,8 @@ namespace tunnel @@ -443,9 +443,8 @@ namespace tunnel
LogPrint (eLogError, "Tunnels: Can't select next hop for ", prevHop->GetIdentHashBase64 ());
return false;
}
if ((i == numHops - 1) &&
((inbound && !hop->IsReachable ()) || // IBGW is not reachable
(!inbound && !hop->IsV4 ()))) // OBEP is not ipv4
if ((i == numHops - 1) && (!hop->IsV4 () || // doesn't support ipv4
(inbound && !hop->IsReachable ()))) // IBGW is not reachable
{
auto hop1 = nextHop (prevHop, true);
if (hop1) hop = hop1;

Loading…
Cancel
Save