diff options
author | peavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-10-16 22:53:14 +0000 |
---|---|---|
committer | peavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-10-16 22:53:14 +0000 |
commit | d164d06d1aaa7fb92ccbbe957dd66082c28b5838 (patch) | |
tree | 98e6c36616f4ddd0be7e7c553521f0f7261684f7 | |
parent | dd27303b9e82c64f7eccb04140ee5b4349c5f1fc (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
-rw-r--r-- | src/usermanager.cpp | 36 |
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 |