compare published address and actual endpoint

This commit is contained in:
orignal 2023-02-05 15:42:46 -05:00
parent 212a1156a1
commit f1415c2234

View File

@ -1047,6 +1047,12 @@ namespace transport
LogPrint (eLogError, "SSU2: No SSU2 address with static key found in SessionConfirmed from ", i2p::data::GetIdentHashAbbreviation (ri->GetIdentHash ()));
return false;
}
if (m_Address->published && m_RemoteEndpoint.address () != m_Address->host)
{
LogPrint (eLogError, "SSU2: Host mismatch between published address ", m_Address->host,
" and actual enpoint ", m_RemoteEndpoint.address (), " from ", i2p::data::GetIdentHashAbbreviation (ri->GetIdentHash ()));
return false;
}
// update RouterInfo in netdb
ri = i2p::data::netdb.AddRouterInfo (ri->GetBuffer (), ri->GetBufferLen ()); // ri points to one from netdb now
if (!ri)