1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-06 16:33:13 +02:00

floodprot (+f): fix issue where 't' was kicking innocent users due to

flooding. The 't' action was activated in if no 'r' type was present
because the counter was not reset.
https://bugs.unrealircd.org/view.php?id=5401
This commit is contained in:
Bram Matthys
2019-09-15 15:33:30 +02:00
parent c7c3fbdfa8
commit f3ec97ee23
+14 -14
View File
@@ -1075,23 +1075,23 @@ int check_for_chan_flood(Client *sptr, Channel *chptr, char *text)
memberflood = (MemberFlood *)moddata_membership(mb, mdflood).ptr;
if ((TStime() - memberflood->firstmsg) >= chp->per)
{
/* Reset due to moving into a new time slot */
memberflood->firstmsg = TStime();
memberflood->nmsg = 1;
memberflood->nmsg_repeat = 1;
if (chp->limit[FLD_REPEAT])
{
memberflood->lastmsg = gen_floodprot_msghash(text);
memberflood->prevmsg = 0;
}
return 0; /* forget about it.. */
}
/* Anti-repeat ('r') */
if (chp->limit[FLD_REPEAT])
{
/* if current - firstmsgtime >= mode.per, then reset,
* if nummsg > mode.msgs then kick/ban
*/
if ((TStime() - memberflood->firstmsg) >= chp->per)
{
/* reset */
memberflood->firstmsg = TStime();
memberflood->nmsg = 1;
memberflood->nmsg_repeat = 1;
memberflood->lastmsg = gen_floodprot_msghash(text);
memberflood->prevmsg = 0;
return 0; /* forget about it.. */
}
msghash = gen_floodprot_msghash(text);
if (memberflood->lastmsg)
{