Tunnels: Ban peer on excessive build requests

Drop requests if previous or next peer is banned
Console: Drop peer when manually banned
Update: Drop peer when banlisted
This commit is contained in:
zzz
2021-11-21 08:17:43 -05:00
parent d7fdd6d9dc
commit e3fc34ef1f
9 changed files with 81 additions and 13 deletions

View File

@@ -651,8 +651,10 @@ class NewsFetcher extends UpdateRunner {
continue;
}
Hash h = Hash.create(b);
if (!ban.isBanlistedForever(h))
if (!ban.isBanlistedForever(h)) {
ban.banlistRouterForever(h, reason);
_context.commSystem().forceDisconnect(h);
}
} else {
byte[] ip = Addresses.getIP(s);
if (ip == null) {

View File

@@ -22,6 +22,7 @@ public class ConfigPeerHandler extends FormHandler {
Hash h = getHash();
if (h != null) {
_context.banlist().banlistRouterForever(h, _t("Manually banned via {0}"), "<a href=\"configpeer\">configpeer</a>");
_context.commSystem().forceDisconnect(h);
addFormNotice(_t("Peer") + " " + _peer + " " + _t("banned until restart") );
return;
}