mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-03-16 06:49:19 +08:00
Ban score should always increase.
Resolves: #246 Signed-off-by: Alan Jowett <alanjo@microsoft.com>
This commit is contained in:
committed by
Nikos Mavrogiannopoulos
parent
17957ed98f
commit
8d1aa343b4
@@ -158,7 +158,9 @@ int add_ip_to_ban_list(main_server_st *s, const unsigned char *ip, unsigned ip_s
|
|||||||
print_msg = 0;
|
print_msg = 0;
|
||||||
} else
|
} else
|
||||||
print_msg = 1;
|
print_msg = 1;
|
||||||
e->score += score;
|
|
||||||
|
/* prevent overflow */
|
||||||
|
e->score = (e->score + score) > e->score ? (e->score + score) : (e->score);
|
||||||
|
|
||||||
if (ip_size == 4)
|
if (ip_size == 4)
|
||||||
p_str_ip = inet_ntop(AF_INET, ip, str_ip, sizeof(str_ip));
|
p_str_ip = inet_ntop(AF_INET, ip, str_ip, sizeof(str_ip));
|
||||||
|
|||||||
Reference in New Issue
Block a user