Only drop banned IPs when drop_banned_ip

Attempted fix of #43
This commit is contained in:
tW4r 2023-02-14 13:47:01 +02:00 committed by GitHub
parent be74e053f4
commit 5c7e17b0ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -84,7 +84,7 @@ fn route(inbound: TcpStream, config: Arc<Config>, server: Arc<Server>) {
// Check ban state, just drop connection if enabled // Check ban state, just drop connection if enabled
let banned = server.is_banned_ip_blocking(&peer.ip()); let banned = server.is_banned_ip_blocking(&peer.ip());
if config.server.drop_banned_ips { if !banned && config.server.drop_banned_ips {
info!(target: "lazymc", "Connection from banned IP {}, dropping", peer.ip()); info!(target: "lazymc", "Connection from banned IP {}, dropping", peer.ip());
return; return;
} }