forked from I2P_Developers/i2p.i2p
Router: Shorter ban time for localhost addresses
This commit is contained in:
@@ -54,6 +54,7 @@ public class Banlist {
|
||||
public final static long BANLIST_DURATION_PARTIAL = 10*60*1000;
|
||||
public final static long BANLIST_DURATION_FOREVER = 181l*24*60*60*1000; // will get rounded down to 180d on console
|
||||
public final static long BANLIST_DURATION_NO_NETWORK = 6*60*60*1000;
|
||||
public final static long BANLIST_DURATION_LOCALHOST = 2*60*60*1000;
|
||||
private final static long BANLIST_CLEANER_START_DELAY = BANLIST_DURATION_PARTIAL;
|
||||
|
||||
public Banlist(RouterContext context) {
|
||||
|
||||
@@ -1025,7 +1025,16 @@ public class Blocklist {
|
||||
private void banlist(Hash peer, byte[] ip) {
|
||||
// Temporary reason, until the job finishes
|
||||
String reason = _x("IP banned by blocklist.txt entry {0}");
|
||||
_context.banlist().banlistRouterForever(peer, reason, Addresses.toString(ip));
|
||||
String sip = Addresses.toString(ip);
|
||||
if ("127.0.0.1".equals(sip) ||
|
||||
"0:0:0:0:0:0:0:1".equals(sip) ||
|
||||
sip.startsWith("192.168.")) {
|
||||
// i2pd bug, possibly at startup, don't ban forever
|
||||
_context.banlist().banlistRouter(peer, reason, sip, null,
|
||||
_context.clock().now() + Banlist.BANLIST_DURATION_LOCALHOST);
|
||||
return;
|
||||
}
|
||||
_context.banlist().banlistRouterForever(peer, reason, sip);
|
||||
if (! _context.getBooleanPropertyDefaultTrue(PROP_BLOCKLIST_DETAIL))
|
||||
return;
|
||||
boolean shouldRunJob;
|
||||
|
||||
Reference in New Issue
Block a user