don't communicate with low bandwidth routers of version < 0.9.58

This commit is contained in:
orignal
2026-02-08 10:45:47 -05:00
parent c93cf9bc2f
commit de0c5c042a
4 changed files with 15 additions and 1 deletions
+6
View File
@@ -1077,6 +1077,12 @@ namespace transport
Terminate ();
return;
}
if (ri1->GetVersion () < i2p::data::NETDB_MIN_ALLOWED_VERSION && !ri1->IsHighBandwidth ())
{
LogPrint (eLogInfo, "NTCP2: Router version ", ri1->GetVersion (), " is too old in SessionConfirmed");
SendTerminationAndTerminate (eNTCP2Banned);
return;
}
// TODO: process options block
// ready to communicate
+1
View File
@@ -54,6 +54,7 @@ namespace data
const int NETDB_MIN_FLOODFILL_VERSION = MAKE_VERSION_NUMBER(0, 9, 62); // 0.9.62
const int NETDB_MIN_SHORT_TUNNEL_BUILD_VERSION = MAKE_VERSION_NUMBER(0, 9, 51); // 0.9.51
const int NETDB_MIN_PEER_TEST_VERSION = MAKE_VERSION_NUMBER(0, 9, 62); // 0.9.62
const int NETDB_MIN_ALLOWED_VERSION = MAKE_VERSION_NUMBER(0, 9, 58); // 0.9.58
const size_t NETDB_MAX_NUM_SEARCH_REPLY_PEER_HASHES = 16;
const size_t NETDB_MAX_EXPLORATORY_SELECTION_SIZE = 500;
const int NETDB_EXPLORATORY_SELECTION_UPDATE_INTERVAL = 82; // in seconds. for floodfill
+5
View File
@@ -1227,6 +1227,11 @@ namespace transport
i2p::transport::transports.AddBan (m_RemoteEndpoint.address ());
return false;
}
if (ri->GetVersion () < i2p::data::NETDB_MIN_ALLOWED_VERSION && !ri->IsHighBandwidth ())
{
LogPrint (eLogInfo, "SSU2: Router version ", ri->GetVersion (), " is too old in SessionConfirmed");
return false;
}
if (!m_Address->published)
{
if (ri->HasProfile ())
+3 -1
View File
@@ -506,7 +506,9 @@ namespace transport
try
{
auto r = netdb.FindRouter (ident);
if (r && (r->IsUnreachable () || !r->IsReachableFrom (i2p::context.GetRouterInfo ()))) return nullptr; // router found but non-reachable
if (r && (r->IsUnreachable () || !r->IsReachableFrom (i2p::context.GetRouterInfo ()) ||
(r->GetVersion () < i2p::data::NETDB_MIN_ALLOWED_VERSION && !r->IsHighBandwidth ())))
return nullptr; // router found but non-reachable or too old
peer = std::make_shared<Peer>(r, i2p::util::GetSecondsSinceEpoch ());
{