Browse Source

don't set Firewalled upon SessionCreated if ports mismatch

pull/1849/head
orignal 2 years ago
parent
commit
a3c305032a
  1. 10
      libi2pd/RouterContext.cpp
  2. 8
      libi2pd/SSU2Session.cpp

10
libi2pd/RouterContext.cpp

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013-2022, The PurpleI2P Project * Copyright (c) 2013-2023, The PurpleI2P Project
* *
* This file is part of Purple i2pd project and licensed under BSD3 * This file is part of Purple i2pd project and licensed under BSD3
* *
@ -240,7 +240,6 @@ namespace i2p
if (status != m_Status) if (status != m_Status)
{ {
m_Status = status; m_Status = status;
m_Error = eRouterErrorNone;
switch (m_Status) switch (m_Status)
{ {
case eRouterStatusOK: case eRouterStatusOK:
@ -249,6 +248,9 @@ namespace i2p
case eRouterStatusFirewalled: case eRouterStatusFirewalled:
SetUnreachable (true, false); // ipv4 SetUnreachable (true, false); // ipv4
break; break;
case eRouterStatusTesting:
m_Error = eRouterErrorNone;
break;
default: default:
; ;
} }
@ -260,7 +262,6 @@ namespace i2p
if (status != m_StatusV6) if (status != m_StatusV6)
{ {
m_StatusV6 = status; m_StatusV6 = status;
m_ErrorV6 = eRouterErrorNone;
switch (m_StatusV6) switch (m_StatusV6)
{ {
case eRouterStatusOK: case eRouterStatusOK:
@ -269,6 +270,9 @@ namespace i2p
case eRouterStatusFirewalled: case eRouterStatusFirewalled:
SetUnreachable (false, true); // ipv6 SetUnreachable (false, true); // ipv6
break; break;
case eRouterStatusTesting:
m_ErrorV6 = eRouterErrorNone;
break;
default: default:
; ;
} }

8
libi2pd/SSU2Session.cpp

@ -1669,22 +1669,14 @@ namespace transport
if (isV4) if (isV4)
{ {
if (i2p::context.GetStatus () == eRouterStatusTesting) if (i2p::context.GetStatus () == eRouterStatusTesting)
{
i2p::context.SetStatus (eRouterStatusFirewalled);
i2p::context.SetError (eRouterErrorSymmetricNAT); i2p::context.SetError (eRouterErrorSymmetricNAT);
m_Server.RescheduleIntroducersUpdateTimer ();
}
else if (m_State == eSSU2SessionStatePeerTest) else if (m_State == eSSU2SessionStatePeerTest)
i2p::context.SetError (eRouterErrorFullConeNAT); i2p::context.SetError (eRouterErrorFullConeNAT);
} }
else else
{ {
if (i2p::context.GetStatusV6 () == eRouterStatusTesting) if (i2p::context.GetStatusV6 () == eRouterStatusTesting)
{
i2p::context.SetStatusV6 (eRouterStatusFirewalled);
i2p::context.SetErrorV6 (eRouterErrorSymmetricNAT); i2p::context.SetErrorV6 (eRouterErrorSymmetricNAT);
m_Server.RescheduleIntroducersUpdateTimerV6 ();
}
else if (m_State == eSSU2SessionStatePeerTest) else if (m_State == eSSU2SessionStatePeerTest)
i2p::context.SetErrorV6 (eRouterErrorFullConeNAT); i2p::context.SetErrorV6 (eRouterErrorFullConeNAT);
} }

Loading…
Cancel
Save