Correct issue where flood detection could become unreliable
The static 'pos' variable in check_flooding() would not stay in sync with the number of entries in flood_list after clean_flood_list() was called. This meant that check_flooding() would always end up removing all previous entries if it tried to add a new one. Fix this by removing the tracking of number of flood_list entries, and just removing stale ones (older than /SET FLOOD_RATE).
This commit is contained in:
@@ -1015,7 +1015,7 @@ typedef struct flood_stru
|
||||
int type;
|
||||
char flood;
|
||||
unsigned long cnt;
|
||||
time_t start;
|
||||
struct timeval start;
|
||||
} Flooding;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user