1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-01-27 21:34:17 +00:00

OBEP must be ipv4 compatible

This commit is contained in:
orignal 2021-03-08 18:54:17 -05:00
parent 97f315d488
commit 60b92f98db

View File

@ -419,7 +419,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->IsReachable ())) // first must be reachable (numHops > 1 || (!inbound && r->IsV4 ()) || r->IsReachable ())) // first inbound must be reachable
{ {
prevHop = r; prevHop = r;
peers.push_back (r->GetRouterIdentity ()); peers.push_back (r->GetRouterIdentity ());
@ -440,9 +440,10 @@ 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 (inbound && (i == numHops - 1) && !hop->IsReachable ()) if ((i == numHops - 1) &&
((inbound && !hop->IsReachable ()) || // IBGW is not reachable
(!inbound && !hop->IsV4 ()))) // OBEP is not ipv4
{ {
// if first is not reachable try again
auto hop1 = nextHop (prevHop, true); auto hop1 = nextHop (prevHop, true);
if (hop1) hop = hop1; if (hop1) hop = hop1;
} }