|
|
@ -729,6 +729,7 @@ namespace transport |
|
|
|
if (!ri1) |
|
|
|
if (!ri1) |
|
|
|
{ |
|
|
|
{ |
|
|
|
LogPrint (eLogError, "NTCP2: Couldn't update RouterInfo from SessionConfirmed in netdb"); |
|
|
|
LogPrint (eLogError, "NTCP2: Couldn't update RouterInfo from SessionConfirmed in netdb"); |
|
|
|
|
|
|
|
Terminate (); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
std::shared_ptr<i2p::data::RouterProfile> profile; // not null if older
|
|
|
|
std::shared_ptr<i2p::data::RouterProfile> profile; // not null if older
|
|
|
@ -737,8 +738,11 @@ namespace transport |
|
|
|
// received RouterInfo is older than one in netdb
|
|
|
|
// received RouterInfo is older than one in netdb
|
|
|
|
profile = i2p::data::GetRouterProfile (ri1->GetIdentHash ()); // retrieve profile
|
|
|
|
profile = i2p::data::GetRouterProfile (ri1->GetIdentHash ()); // retrieve profile
|
|
|
|
if (profile && profile->IsDuplicated ()) |
|
|
|
if (profile && profile->IsDuplicated ()) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
SendTerminationAndTerminate (eNTCP2Banned); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
auto addr = m_RemoteEndpoint.address ().is_v4 () ? ri1->GetNTCP2V4Address () : |
|
|
|
auto addr = m_RemoteEndpoint.address ().is_v4 () ? ri1->GetNTCP2V4Address () : |
|
|
|
(i2p::util::net::IsYggdrasilAddress (m_RemoteEndpoint.address ()) ? ri1->GetYggdrasilAddress () : ri1->GetNTCP2V6Address ()); |
|
|
|
(i2p::util::net::IsYggdrasilAddress (m_RemoteEndpoint.address ()) ? ri1->GetYggdrasilAddress () : ri1->GetNTCP2V6Address ()); |
|
|
@ -756,8 +760,8 @@ namespace transport |
|
|
|
if (profile) // older router?
|
|
|
|
if (profile) // older router?
|
|
|
|
profile->Duplicated (); // mark router as duplicated in profile
|
|
|
|
profile->Duplicated (); // mark router as duplicated in profile
|
|
|
|
else |
|
|
|
else |
|
|
|
LogPrint (eLogError, "NTCP2: Host mismatch between published address ", addr->host, " and actual endpoint ", m_RemoteEndpoint.address ()); |
|
|
|
LogPrint (eLogInfo, "NTCP2: Host mismatch between published address ", addr->host, " and actual endpoint ", m_RemoteEndpoint.address ()); |
|
|
|
Terminate (); |
|
|
|
SendTerminationAndTerminate (eNTCP2Banned); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
// TODO: process options
|
|
|
|
// TODO: process options
|
|
|
|