diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-04-29 08:28:33 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-04-29 08:28:33 +0000 |
commit | 483ec8439c6564f8e3783223a01c641326b6f2d8 (patch) | |
tree | 15060c4e0ab845d5e2200c6841defb6ffebfea5d /src | |
parent | b14bd7e6682f2d3db52a512f6dddded39d328c63 (diff) |
A few anti-flood features
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1260 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/inspircd.cpp | 12 | ||||
-rw-r--r-- | src/xline.cpp | 8 |
2 files changed, 16 insertions, 4 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp index c42306a30..2558f3efc 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -4101,6 +4101,18 @@ int InspIRCd(void) while (current->BufferIsReady()) { floodlines++; + if (TIME > current->reset_due) + { + current->reset_due = TIME+3; + current->lines_in = 0; + } + current->lines_in++; + if (current->lines_in > current->flood) + { + log(DEFAULT,"Excess flood from: %s!%s@%s",current->nick,current->ident,current->host); + WriteOpers("*** Excess flood from: %s!%s@%s",current->nick,current->ident,current->host); + kill_link(current,"Excess flood"); + } if ((floodlines > current->flood) && (current->flood != 0)) { if (current->registered == 7) diff --git a/src/xline.cpp b/src/xline.cpp index 35ebc50f3..92f5ac3a4 100644 --- a/src/xline.cpp +++ b/src/xline.cpp @@ -663,7 +663,7 @@ void apply_lines() char* check = matches_gline(host); if (check) { - WriteOpers("*** User %s matches G-Line: %s",u->registered == 7 ? u->second->nick:"<unknown>",check); + WriteOpers("*** User %s matches G-Line: %s",u->second->registered == 7 ? u->second->nick:"<unknown>",check); snprintf(reason,MAXBUF,"G-Lined: %s",check); kill_link(u->second,reason); go_again = true; @@ -675,7 +675,7 @@ void apply_lines() char* check = matches_kline(host); if (check) { - WriteOpers("*** User %s matches K-Line: %s",u->registered == 7 ? u->second->nick:"<unknown>",check); + WriteOpers("*** User %s matches K-Line: %s",u->second->registered == 7 ? u->second->nick:"<unknown>",check); snprintf(reason,MAXBUF,"K-Lined: %s",check); kill_link(u->second,reason); go_again = true; @@ -688,7 +688,7 @@ void apply_lines() if (check) { snprintf(reason,MAXBUF,"Matched Q-Lined nick: %s",check); - WriteOpers("*** Q-Lined nickname %s from %s: %s",u->registered == 7 ? u->second->nick:"<unknown>",u->second->host,check); + WriteOpers("*** Q-Lined nickname %s from %s: %s",u->second->registered == 7 ? u->second->nick:"<unknown>",u->second->host,check); kill_link(u->second,reason); go_again = true; break; @@ -700,7 +700,7 @@ void apply_lines() if (check) { snprintf(reason,MAXBUF,"Z-Lined: %s",check); - WriteOpers("*** User %s matches Z-Line: %s",u->registered == 7 ? u->second->nick:"<unknown>",u->second->host,check); + WriteOpers("*** User %s matches Z-Line: %s",u->second->registered == 7 ? u->second->nick:"<unknown>",u->second->host,check); kill_link(u->second,reason); go_again = true; break; |