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:
HardenedSteel
2025-12-14 23:08:12 +03:00
parent 786ccc16d4
commit 76a481a759
+6
View File
@@ -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