Skip to content

Commit

Permalink
Merge branch 'i2p.i2p.2.3.0-DLM-MR' into 'master'
Browse files Browse the repository at this point in the history
NetDb: Disable Burst Banning on DLM.

See merge request i2p-hackers/i2p.i2p!102
  • Loading branch information
eyedeekay committed Sep 5, 2023
2 parents 4e63234 + dc68fdc commit c1c8cfc
Showing 1 changed file with 5 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)) {
Expand All @@ -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(), " <b>➜</b> 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())) {
Expand Down

0 comments on commit c1c8cfc

Please sign in to comment.