mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2026-08-28 22:28:28 +00:00
feat: change published port if full-cone
If we're behind full-cone NAT; update our published port number while keeping our listening port number, so other peers can connect us even we're behind NAT.
This commit is contained in:
@@ -1838,14 +1838,20 @@ namespace transport
|
||||
if (i2p::context.GetTesting ())
|
||||
i2p::context.SetError (eRouterErrorSymmetricNAT);
|
||||
else if (m_State == eSSU2SessionStatePeerTest)
|
||||
{
|
||||
i2p::context.SetError (eRouterErrorFullConeNAT);
|
||||
i2p::context.UpdatePort((int)ep.port ());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (i2p::context.GetTestingV6 ())
|
||||
i2p::context.SetErrorV6 (eRouterErrorSymmetricNAT);
|
||||
else if (m_State == eSSU2SessionStatePeerTest)
|
||||
{
|
||||
i2p::context.SetErrorV6 (eRouterErrorFullConeNAT);
|
||||
i2p::context.UpdatePort((int)ep.port ());
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user