Browse Source

require ipv4 for IBGW

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

7
libi2pd/TunnelPool.cpp

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

Loading…
Cancel
Save