diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-01 11:46:19 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-01 11:46:19 +0000 |
commit | 4488e477136ea3daa60a744bac272cc37a604136 (patch) | |
tree | 49ec2884832cea192feb6a667f9ec8d352c14199 /src/users.cpp | |
parent | 4789b3f6536ef8267c79c7cb3ee6678546c2150b (diff) |
The IPV6 stuff compiles now, with compile-correct ipv6 code. I dont know if this works yet.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4611 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/users.cpp')
-rw-r--r-- | src/users.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/users.cpp b/src/users.cpp index f52f05b10..93ffadb83 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -706,7 +706,7 @@ void AddClient(int socket, int port, bool iscached, insp_inaddr ip4) { std::string tempnick = ConvToStr(socket) + "-unknown"; user_hash::iterator iter = clientlist.find(tempnick); - const char *ipaddr = inet_ntoa(ip4); + const char *ipaddr = insp_ntoa(ip4); userrec* _new; int j = 0; @@ -832,8 +832,12 @@ long FindMatchingGlobal(userrec* user) long x = 0; for (user_hash::const_iterator a = clientlist.begin(); a != clientlist.end(); a++) { +#ifdef IPV6 + /* TODO: clone matching for ipv6 */ +#else if (a->second->ip4.s_addr == user->ip4.s_addr) x++; +#endif } return x; } @@ -843,9 +847,13 @@ long FindMatchingLocal(userrec* user) long x = 0; for (std::vector<userrec*>::const_iterator a = local_users.begin(); a != local_users.end(); a++) { - userrec* comp = (userrec*)(*a); +#ifdef IPV6 + /* TODO clone matching for ipv6 */ +#else + userrec* comp = *a; if (comp->ip4.s_addr == user->ip4.s_addr) x++; +#endif } return x; } @@ -873,13 +881,13 @@ void FullConnectUser(userrec* user, CullList* Goners) if (FindMatchingLocal(user) > a.maxlocal) { Goners->AddItem(user,"No more connections allowed from your host via this connect class (local)"); - WriteOpers("*** WARNING: maximum LOCAL connections (%ld) exceeded for IP %s",a.maxlocal,inet_ntoa(user->ip4)); + WriteOpers("*** WARNING: maximum LOCAL connections (%ld) exceeded for IP %s",a.maxlocal,insp_ntoa(user->ip4)); return; } else if (FindMatchingGlobal(user) > a.maxglobal) { Goners->AddItem(user,"No more connections allowed from your host via this connect class (global)"); - WriteOpers("*** WARNING: maximum GLOBAL connections (%ld) exceeded for IP %s",a.maxglobal,inet_ntoa(user->ip4)); + WriteOpers("*** WARNING: maximum GLOBAL connections (%ld) exceeded for IP %s",a.maxglobal,insp_ntoa(user->ip4)); return; } @@ -947,7 +955,7 @@ void FullConnectUser(userrec* user, CullList* Goners) FOREACH_MOD(I_OnUserConnect,OnUserConnect(user)); FOREACH_MOD(I_OnGlobalConnect,OnGlobalConnect(user)); user->registered = REG_ALL; - WriteOpers("*** Client connecting on port %lu: %s!%s@%s [%s]",(unsigned long)user->port,user->nick,user->ident,user->host,inet_ntoa(user->ip4)); + WriteOpers("*** Client connecting on port %lu: %s!%s@%s [%s]",(unsigned long)user->port,user->nick,user->ident,user->host,insp_ntoa(user->ip4)); } /** ReHashNick() |