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 @@ @@ -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
*
@ -240,7 +240,6 @@ namespace i2p @@ -240,7 +240,6 @@ namespace i2p
if (status != m_Status)
{
m_Status = status;
m_Error = eRouterErrorNone;
switch (m_Status)
{
case eRouterStatusOK:
@ -249,6 +248,9 @@ namespace i2p @@ -249,6 +248,9 @@ namespace i2p
case eRouterStatusFirewalled:
SetUnreachable (true, false); // ipv4
break;
case eRouterStatusTesting:
m_Error = eRouterErrorNone;
break;
default:
;
}
@ -260,7 +262,6 @@ namespace i2p @@ -260,7 +262,6 @@ namespace i2p
if (status != m_StatusV6)
{
m_StatusV6 = status;
m_ErrorV6 = eRouterErrorNone;
switch (m_StatusV6)
{
case eRouterStatusOK:
@ -269,6 +270,9 @@ namespace i2p @@ -269,6 +270,9 @@ namespace i2p
case eRouterStatusFirewalled:
SetUnreachable (false, true); // ipv6
break;
case eRouterStatusTesting:
m_ErrorV6 = eRouterErrorNone;
break;
default:
;
}

8
libi2pd/SSU2Session.cpp

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

Loading…
Cancel
Save