mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 20:44:39 +00:00
update our IP adress from SSU2
This commit is contained in:
parent
50419f200d
commit
6143515ac6
@ -719,13 +719,13 @@ namespace transport
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
SetRemoteIdentity (ri->GetRouterIdentity ());
|
SetRemoteIdentity (ri->GetRouterIdentity ());
|
||||||
m_Server.AddSessionByRouterHash (shared_from_this ()); // we know remote router now
|
|
||||||
m_Address = ri->GetSSU2AddressWithStaticKey (S, m_RemoteEndpoint.address ().is_v6 ());
|
m_Address = ri->GetSSU2AddressWithStaticKey (S, m_RemoteEndpoint.address ().is_v6 ());
|
||||||
if (!m_Address)
|
if (!m_Address)
|
||||||
{
|
{
|
||||||
LogPrint (eLogError, "SSU2: No SSU2 address with static key found in SessionConfirmed");
|
LogPrint (eLogError, "SSU2: No SSU2 address with static key found in SessionConfirmed");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
m_Server.AddSessionByRouterHash (shared_from_this ()); // we know remote router now
|
||||||
m_RemoteTransports = ri->GetCompatibleTransports (false);
|
m_RemoteTransports = ri->GetCompatibleTransports (false);
|
||||||
i2p::data::netdb.PostI2NPMsg (CreateDatabaseStoreMsg (ri)); // TODO: should insert ri
|
i2p::data::netdb.PostI2NPMsg (CreateDatabaseStoreMsg (ri)); // TODO: should insert ri
|
||||||
// handle other blocks
|
// handle other blocks
|
||||||
@ -1177,7 +1177,11 @@ namespace transport
|
|||||||
{
|
{
|
||||||
boost::asio::ip::udp::endpoint ep;
|
boost::asio::ip::udp::endpoint ep;
|
||||||
if (ExtractEndpoint (buf + offset, size, ep))
|
if (ExtractEndpoint (buf + offset, size, ep))
|
||||||
|
{
|
||||||
LogPrint (eLogInfo, "SSU2: Our external address is ", ep);
|
LogPrint (eLogInfo, "SSU2: Our external address is ", ep);
|
||||||
|
if (!i2p::util::net::IsInReservedRange (ep.address ()))
|
||||||
|
i2p::context.UpdateAddress (ep.address ());
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case eSSU2BlkIntroKey:
|
case eSSU2BlkIntroKey:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user