Another fix for IP Guard
This commit is contained in:
parent
4fdc670c7f
commit
24b1aa87cc
2
main.c
2
main.c
@ -975,7 +975,7 @@ void server(int port) {
|
|||||||
close(client_sock);
|
close(client_sock);
|
||||||
continue;
|
continue;
|
||||||
} else if (ip_guard->status == IP_STATUS_UNKNOWN) {
|
} else if (ip_guard->status == IP_STATUS_UNKNOWN) {
|
||||||
if (ip_guard->last_connection < time(NULL) + conf.ipguard_timeout) {
|
if (ip_guard->last_connection + conf.ipguard_timeout > time(NULL)) {
|
||||||
ip_guard->connection_count++;
|
ip_guard->connection_count++;
|
||||||
if (ip_guard->connection_count == conf.ipguard_tries) {
|
if (ip_guard->connection_count == conf.ipguard_tries) {
|
||||||
ip_guard->status = IP_STATUS_BLACKLISTED;
|
ip_guard->status = IP_STATUS_BLACKLISTED;
|
||||||
|
Reference in New Issue
Block a user