summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2008-10-16 22:53:14 +0000
committerpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2008-10-16 22:53:14 +0000
commitd164d06d1aaa7fb92ccbbe957dd66082c28b5838 (patch)
tree98e6c36616f4ddd0be7e7c553521f0f7261684f7 /src
parentdd27303b9e82c64f7eccb04140ee5b4349c5f1fc (diff)
possible fix for bug #623, reported by MacGyver. Untested please test :D
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10651 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/usermanager.cpp36
1 files changed, 34 insertions, 2 deletions
diff --git a/src/usermanager.cpp b/src/usermanager.cpp
index 1cb269bdf..e526238ed 100644
--- a/src/usermanager.cpp
+++ b/src/usermanager.cpp
@@ -282,7 +282,23 @@ void UserManager::RemoveCloneCounts(User *user)
unsigned long UserManager::GlobalCloneCount(User *user)
{
- clonemap::iterator x = global_clones.find(user->GetIPString());
+ int range = 32;
+ switch (user->GetProtocolFamily())
+ {
+#ifdef SUPPORT_IP6LINKS
+ case AF_INET6:
+ {
+ range = ServerInstance->Config->c_ipv6_range;
+ }
+ break;
+#endif
+ case AF_INET:
+ {
+ range = ServerInstance->Config->c_ipv4_range;
+ }
+ break;
+ }
+ clonemap::iterator x = global_clones.find(user->GetCIDRMask(range));
if (x != global_clones.end())
return x->second;
else
@@ -291,7 +307,23 @@ unsigned long UserManager::GlobalCloneCount(User *user)
unsigned long UserManager::LocalCloneCount(User *user)
{
- clonemap::iterator x = local_clones.find(user->GetIPString());
+ int range = 32;
+ switch (user->GetProtocolFamily())
+ {
+#ifdef SUPPORT_IP6LINKS
+ case AF_INET6:
+ {
+ range = ServerInstance->Config->c_ipv6_range;
+ }
+ break;
+#endif
+ case AF_INET:
+ {
+ range = ServerInstance->Config->c_ipv4_range;
+ }
+ break;
+ }
+ clonemap::iterator x = local_clones.find(user->GetCIDRMask(range));
if (x != local_clones.end())
return x->second;
else