mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-02-02 06:54:15 +00:00
compare only first 8 bytes for temporary addreses
This commit is contained in:
parent
21123e2afa
commit
3c02cade58
@ -701,7 +701,9 @@ namespace transport
|
|||||||
Terminate ();
|
Terminate ();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (addr->IsPublishedNTCP2 () && m_RemoteEndpoint.address () != addr->host)
|
if (addr->IsPublishedNTCP2 () && m_RemoteEndpoint.address () != addr->host &&
|
||||||
|
(!m_RemoteEndpoint.address ().is_v6 () ||
|
||||||
|
memcmp (m_RemoteEndpoint.address ().to_v6 ().to_bytes ().data (), addr->host.to_v6 ().to_bytes ().data (), 8))) // temporary address
|
||||||
{
|
{
|
||||||
LogPrint (eLogError, "NTCP2: Host mismatch between published address ", addr->host, " and actual endpoint ", m_RemoteEndpoint.address ());
|
LogPrint (eLogError, "NTCP2: Host mismatch between published address ", addr->host, " and actual endpoint ", m_RemoteEndpoint.address ());
|
||||||
Terminate ();
|
Terminate ();
|
||||||
|
@ -1047,7 +1047,9 @@ namespace transport
|
|||||||
LogPrint (eLogError, "SSU2: Wrong static key in SessionConfirmed from ", i2p::data::GetIdentHashAbbreviation (ri->GetIdentHash ()));
|
LogPrint (eLogError, "SSU2: Wrong static key in SessionConfirmed from ", i2p::data::GetIdentHashAbbreviation (ri->GetIdentHash ()));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (m_Address->published && m_RemoteEndpoint.address () != m_Address->host)
|
if (m_Address->published && m_RemoteEndpoint.address () != m_Address->host &&
|
||||||
|
(!m_RemoteEndpoint.address ().is_v6 () ||
|
||||||
|
memcmp (m_RemoteEndpoint.address ().to_v6 ().to_bytes ().data (), m_Address->host.to_v6 ().to_bytes ().data (), 8))) // temporary address
|
||||||
{
|
{
|
||||||
LogPrint (eLogError, "SSU2: Host mismatch between published address ", m_Address->host,
|
LogPrint (eLogError, "SSU2: Host mismatch between published address ", m_Address->host,
|
||||||
" and actual endpoint ", m_RemoteEndpoint.address (), " from ", i2p::data::GetIdentHashAbbreviation (ri->GetIdentHash ()));
|
" and actual endpoint ", m_RemoteEndpoint.address (), " from ", i2p::data::GetIdentHashAbbreviation (ri->GetIdentHash ()));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user