Allow NAT64 client to connect to firewalled IPv4 server

This commit is contained in:
Benau 2020-01-23 16:50:47 +08:00
parent 63c7c711d5
commit 8d94f973cc

View File

@ -278,19 +278,11 @@ void ConnectToServer::asynchronousUpdate()
// direct connection to server first, if failed than use the one
// that has stun mapped, the first 8 seconds allow the server to
// start the connect to peer protocol first before the port is
// remapped. IPv6 has no stun so try once with any port
if (isIPv6Socket())
{
if (!tryConnect(2000, 15, true/*another_port*/, true/*IPv6*/))
m_state = DONE;
}
else
{
if (tryConnect(2000, 4, true/*another_port*/))
break;
if (!tryConnect(2000, 11))
m_state = DONE;
}
// remapped.
if (tryConnect(2000, 4, true/*another_port*/, isIPv6Socket()))
break;
if (!tryConnect(2000, 11, false/*another_port*/, isIPv6Socket()))
m_state = DONE;
break;
}
case DONE: