mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 00:00:29 +03:00
differentiate symmetric and full cone NAT
This commit is contained in:
parent
c18e8f6c78
commit
1cc68ea402
@ -245,6 +245,9 @@ namespace http {
|
|||||||
case eRouterErrorSymmetricNAT:
|
case eRouterErrorSymmetricNAT:
|
||||||
s << " - " << tr("Symmetric NAT");
|
s << " - " << tr("Symmetric NAT");
|
||||||
break;
|
break;
|
||||||
|
case eRouterErrorFullConeNAT:
|
||||||
|
s << " - " << tr("Full cone NAT");
|
||||||
|
break;
|
||||||
case eRouterErrorNoDescriptors:
|
case eRouterErrorNoDescriptors:
|
||||||
s << " - " << tr("No Descriptors");
|
s << " - " << tr("No Descriptors");
|
||||||
break;
|
break;
|
||||||
|
@ -1668,23 +1668,25 @@ namespace transport
|
|||||||
LogPrint (eLogInfo, "SSU2: Our port ", ep.port (), " received from ", m_RemoteEndpoint, " is different from ", m_Server.GetPort (isV4));
|
LogPrint (eLogInfo, "SSU2: Our port ", ep.port (), " received from ", m_RemoteEndpoint, " is different from ", m_Server.GetPort (isV4));
|
||||||
if (isV4)
|
if (isV4)
|
||||||
{
|
{
|
||||||
if (i2p::context.GetStatus () == eRouterStatusTesting ||
|
if (i2p::context.GetStatus () == eRouterStatusTesting)
|
||||||
m_State == eSSU2SessionStatePeerTest)
|
|
||||||
{
|
{
|
||||||
i2p::context.SetStatus (eRouterStatusFirewalled);
|
i2p::context.SetStatus (eRouterStatusFirewalled);
|
||||||
i2p::context.SetError (eRouterErrorSymmetricNAT);
|
i2p::context.SetError (eRouterErrorSymmetricNAT);
|
||||||
m_Server.RescheduleIntroducersUpdateTimer ();
|
m_Server.RescheduleIntroducersUpdateTimer ();
|
||||||
}
|
}
|
||||||
|
else if (m_State == eSSU2SessionStatePeerTest)
|
||||||
|
i2p::context.SetError (eRouterErrorFullConeNAT);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (i2p::context.GetStatusV6 () == eRouterStatusTesting ||
|
if (i2p::context.GetStatusV6 () == eRouterStatusTesting)
|
||||||
m_State == eSSU2SessionStatePeerTest)
|
|
||||||
{
|
{
|
||||||
i2p::context.SetStatusV6 (eRouterStatusFirewalled);
|
i2p::context.SetStatusV6 (eRouterStatusFirewalled);
|
||||||
i2p::context.SetErrorV6 (eRouterErrorSymmetricNAT);
|
i2p::context.SetErrorV6 (eRouterErrorSymmetricNAT);
|
||||||
m_Server.RescheduleIntroducersUpdateTimerV6 ();
|
m_Server.RescheduleIntroducersUpdateTimerV6 ();
|
||||||
}
|
}
|
||||||
|
else if (m_State == eSSU2SessionStatePeerTest)
|
||||||
|
i2p::context.SetErrorV6 (eRouterErrorFullConeNAT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1697,6 +1699,8 @@ namespace transport
|
|||||||
i2p::context.SetStatus (eRouterStatusOK);
|
i2p::context.SetStatus (eRouterStatusOK);
|
||||||
i2p::context.SetError (eRouterErrorNone);
|
i2p::context.SetError (eRouterErrorNone);
|
||||||
}
|
}
|
||||||
|
else if (i2p::context.GetError () == eRouterErrorFullConeNAT)
|
||||||
|
i2p::context.SetError (eRouterErrorNone);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1706,6 +1710,8 @@ namespace transport
|
|||||||
i2p::context.SetStatusV6 (eRouterStatusOK);
|
i2p::context.SetStatusV6 (eRouterStatusOK);
|
||||||
i2p::context.SetErrorV6 (eRouterErrorNone);
|
i2p::context.SetErrorV6 (eRouterErrorNone);
|
||||||
}
|
}
|
||||||
|
else if (i2p::context.GetErrorV6 () == eRouterErrorFullConeNAT)
|
||||||
|
i2p::context.SetErrorV6 (eRouterErrorNone);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user