mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-22 00:59:08 +01:00
Symmetric NAT error
This commit is contained in:
parent
57c969b0ed
commit
6d88c3ab05
4 changed files with 8 additions and 1 deletions
|
@ -263,6 +263,9 @@ namespace http {
|
||||||
case eRouterErrorOffline:
|
case eRouterErrorOffline:
|
||||||
s << " - Offline";
|
s << " - Offline";
|
||||||
break;
|
break;
|
||||||
|
case eRouterErrorSymmetricNAT:
|
||||||
|
s << " - Symmetric NAT";
|
||||||
|
break;
|
||||||
default: ;
|
default: ;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -39,7 +39,8 @@ namespace i2p
|
||||||
{
|
{
|
||||||
eRouterErrorNone = 0,
|
eRouterErrorNone = 0,
|
||||||
eRouterErrorClockSkew = 1,
|
eRouterErrorClockSkew = 1,
|
||||||
eRouterErrorOffline = 2
|
eRouterErrorOffline = 2,
|
||||||
|
eRouterErrorSymmetricNAT = 3
|
||||||
};
|
};
|
||||||
|
|
||||||
class RouterContext: public i2p::garlic::GarlicDestination
|
class RouterContext: public i2p::garlic::GarlicDestination
|
||||||
|
|
|
@ -63,6 +63,7 @@ namespace transport
|
||||||
void DeleteAllSessions ();
|
void DeleteAllSessions ();
|
||||||
|
|
||||||
boost::asio::io_service& GetService () { return m_Service; };
|
boost::asio::io_service& GetService () { return m_Service; };
|
||||||
|
uint16_t GetPort () const { return m_Endpoint.port (); };
|
||||||
void SetLocalAddress (const boost::asio::ip::address& localAddress);
|
void SetLocalAddress (const boost::asio::ip::address& localAddress);
|
||||||
|
|
||||||
void Send (const uint8_t * buf, size_t len, const boost::asio::ip::udp::endpoint& to);
|
void Send (const uint8_t * buf, size_t len, const boost::asio::ip::udp::endpoint& to);
|
||||||
|
|
|
@ -684,6 +684,8 @@ namespace transport
|
||||||
buf += 2; // our port
|
buf += 2; // our port
|
||||||
LogPrint (eLogInfo, "SSU: Our external address is ", ourIP.to_string (), ":", ourPort);
|
LogPrint (eLogInfo, "SSU: Our external address is ", ourIP.to_string (), ":", ourPort);
|
||||||
i2p::context.UpdateAddress (ourIP);
|
i2p::context.UpdateAddress (ourIP);
|
||||||
|
if (ourPort != m_Server.GetPort ())
|
||||||
|
i2p::context.SetError (eRouterErrorSymmetricNAT);
|
||||||
uint32_t nonce = bufbe32toh (buf);
|
uint32_t nonce = bufbe32toh (buf);
|
||||||
buf += 4; // nonce
|
buf += 4; // nonce
|
||||||
auto it = m_RelayRequests.find (nonce);
|
auto it = m_RelayRequests.find (nonce);
|
||||||
|
|
Loading…
Add table
Reference in a new issue