From dc68fdc0a012866ee940916461568462f996f20c Mon Sep 17 00:00:00 2001 From: obscuratus Date: Sun, 3 Sep 2023 21:35:19 +0000 Subject: [PATCH] NetDb: Disable Burst Banning on DLM. Disable the banning of routers due to excessive Database Lookup Messages (DLM) until a reliable method is identified for discriminating between routers that are merely forwarding someone else's DLM, and routers that are directly sending excessive DLM. Signed-off-by: obscuratus --- ...FloodfillDatabaseLookupMessageHandler.java | 22 +++++-------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillDatabaseLookupMessageHandler.java b/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillDatabaseLookupMessageHandler.java index 8a9533c497..2d83e62d26 100644 --- a/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillDatabaseLookupMessageHandler.java +++ b/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillDatabaseLookupMessageHandler.java @@ -84,6 +84,10 @@ public Job createJob(I2NPMessage receivedMessage, RouterIdentity from, Hash from return null; } + // Implementation of the banning of routers based on excessive burst DLM + // is pending a reliable way to discriminate between DLM that are sent + // and replied directly, and DLM that are forwarded by a router OBEP. + /***** if (_facade.shouldBanLookup(dlm.getFrom(), dlm.getReplyTunnel())) { if (_log.shouldLog(Log.WARN)) { _log.warn("[dbid: " + _facade._dbid @@ -93,10 +97,6 @@ public Job createJob(I2NPMessage receivedMessage, RouterIdentity from, Hash from + dlm.getFrom() + " tunnel: " + dlm.getReplyTunnel()); _context.statManager().addRateData("netDb.repeatedLookupsDropped", 1); } - /* - * TODO: Keep a close eye on this, if it results in too many bans then just back - * it out. - */ } if (_facade.shouldBanBurstLookup(dlm.getFrom(), dlm.getReplyTunnel())) { if (_log.shouldLog(Log.WARN)) { @@ -114,19 +114,7 @@ public Job createJob(I2NPMessage receivedMessage, RouterIdentity from, Hash from _context.statManager().addRateData("netDb.lookupsDropped", 1); return null; } - if (_facade.shouldBanBurstLookup(dlm.getFrom(), dlm.getReplyTunnel())) { - if (_log.shouldLog(Log.WARN)) { - _log.warn("Banning " + dlm.getSearchType() + " lookup request for " + dlm.getSearchKey() - + " because requests are being sent extremely fast in a very short time, reply was to: " - + dlm.getFrom() + " tunnel: " + dlm.getReplyTunnel()); - _context.statManager().addRateData("netDb.repeatedBurstLookupsDropped", 1); - } - _context.banlist().banlistRouter(dlm.getFrom(), " Excessive lookup requests, burst", null, null, - _context.clock().now() + 4 * 60 * 60 * 1000); - _context.commSystem().mayDisconnect(dlm.getFrom()); - _context.statManager().addRateData("netDb.lookupsDropped", 1); - return null; - } + *****/ if ((!_facade.shouldThrottleLookup(dlm.getFrom(), dlm.getReplyTunnel()) && !_facade.shouldThrottleBurstLookup(dlm.getFrom(), dlm.getReplyTunnel())) || _context.routerHash().equals(dlm.getFrom())) {