connectban: never flood-ban loopback (127.0.0.1/::1) and add a connectban_exempt glob/cidr list
This commit is contained in:
parent
59b0439b79
commit
7d57e4ed34
3 changed files with 19 additions and 0 deletions
|
|
@ -24,6 +24,10 @@ fn cfg(s: &Server) -> Option<(u32, u64)> {
|
|||
/// Record a connection from `ip`; returns true when it exceeds the limit (the
|
||||
/// caller should refuse it). No-op → false when connflood is unconfigured.
|
||||
pub fn over_limit(s: &mut Server, ip: IpAddr) -> bool {
|
||||
// loopback (local services / bridges / admin) is never connection-throttled
|
||||
if ip.is_loopback() {
|
||||
return false;
|
||||
}
|
||||
let Some((max, secs)) = cfg(s) else {
|
||||
return false;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue