mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-12 12:09:03 -04:00
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
This commit is contained in:
parent
dd27303b9e
commit
d164d06d1a
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user