diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-10-22 21:49:39 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-10-22 21:49:39 +0000 |
commit | b43fc66c17c2bef6dca66a966676b8128d5774ee (patch) | |
tree | 1d7aa401ffbf682595e1152ae97d2e2d0fcd8d7a /src/modules/m_connectban.cpp | |
parent | f49a18e9abc210cb7ec4a691691cbbefe51a1854 (diff) |
Make irc::sockets::* parameters consistent, add irc::sockets::mask
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11953 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_connectban.cpp')
-rw-r--r-- | src/modules/m_connectban.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/modules/m_connectban.cpp b/src/modules/m_connectban.cpp index 9506bc2fe..735f3da99 100644 --- a/src/modules/m_connectban.cpp +++ b/src/modules/m_connectban.cpp @@ -81,7 +81,8 @@ class ModuleConnectBan : public Module break; } - i = connects.find(u->GetCIDRMask(range)); + irc::string mask = assign(irc::sockets::mask(u->client_sa, range)); + i = connects.find(mask); if (i != connects.end()) { @@ -90,21 +91,21 @@ class ModuleConnectBan : public Module if (i->second >= threshold) { // Create zline for set duration. - ZLine* zl = new ZLine(ServerInstance->Time(), banduration, ServerInstance->Config->ServerName.c_str(), "Connect flooding", u->GetCIDRMask(range)); + ZLine* zl = new ZLine(ServerInstance->Time(), banduration, ServerInstance->Config->ServerName.c_str(), "Connect flooding", mask.c_str()); if (ServerInstance->XLines->AddLine(zl,NULL)) ServerInstance->XLines->ApplyLines(); else delete zl; ServerInstance->SNO->WriteGlobalSno('x',"Module m_connectban added Z:line on *@%s to expire on %s: Connect flooding", - u->GetCIDRMask(range), ServerInstance->TimeString(zl->expiry).c_str()); - ServerInstance->SNO->WriteGlobalSno('a', "Connect flooding from IP range %s (%d)", u->GetCIDRMask(range), threshold); + mask.c_str(), ServerInstance->TimeString(zl->expiry).c_str()); + ServerInstance->SNO->WriteGlobalSno('a', "Connect flooding from IP range %s (%d)", mask.c_str(), threshold); connects.erase(i); } } else { - connects[u->GetCIDRMask(range)] = 1; + connects[mask] = 1; } } |