|
|
@ -1132,10 +1132,14 @@ namespace transport |
|
|
|
LogPrint (eLogError, "SSU2: Couldn't update RouterInfo from SessionConfirmed in netdb"); |
|
|
|
LogPrint (eLogError, "SSU2: Couldn't update RouterInfo from SessionConfirmed in netdb"); |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
bool isOlder = false; |
|
|
|
std::shared_ptr<i2p::data::RouterProfile> profile; // not null if older
|
|
|
|
if (ri->GetTimestamp () + i2p::data::NETDB_EXPIRATION_TIMEOUT_THRESHOLD*1000LL < ri1->GetTimestamp ()) |
|
|
|
if (ri->GetTimestamp () + i2p::data::NETDB_EXPIRATION_TIMEOUT_THRESHOLD*1000LL < ri1->GetTimestamp ()) |
|
|
|
|
|
|
|
{ |
|
|
|
// received RouterInfo is older than one in netdb
|
|
|
|
// received RouterInfo is older than one in netdb
|
|
|
|
isOlder = true; |
|
|
|
profile = i2p::data::GetRouterProfile (ri->GetIdentHash ()); // retrieve profile
|
|
|
|
|
|
|
|
if (profile && profile->IsDuplicated ()) |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
ri = ri1; |
|
|
|
ri = ri1; |
|
|
|
|
|
|
|
|
|
|
|
m_Address = m_RemoteEndpoint.address ().is_v6 () ? ri->GetSSU2V6Address () : ri->GetSSU2V4Address (); |
|
|
|
m_Address = m_RemoteEndpoint.address ().is_v6 () ? ri->GetSSU2V6Address () : ri->GetSSU2V4Address (); |
|
|
@ -1148,11 +1152,8 @@ namespace transport |
|
|
|
(!m_RemoteEndpoint.address ().is_v6 () || |
|
|
|
(!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
|
|
|
|
memcmp (m_RemoteEndpoint.address ().to_v6 ().to_bytes ().data (), m_Address->host.to_v6 ().to_bytes ().data (), 8))) // temporary address
|
|
|
|
{ |
|
|
|
{ |
|
|
|
if (isOlder) |
|
|
|
if (profile) // older router?
|
|
|
|
{ |
|
|
|
profile->Duplicated (); // mark router as duplicated in profile
|
|
|
|
auto profile = i2p::data::GetRouterProfile (ri->GetIdentHash ()); |
|
|
|
|
|
|
|
if (profile) profile->Duplicated (); // mark router as duplicated in profile
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
else |
|
|
|
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 ())); |
|
|
|