From 653638c68684ec035fd58bc2d0d91c9bf9aa2ab9 Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 27 Jan 2006 15:26:59 +0000 Subject: Improved IP handling. Now uses in_addr to store client ip, not char[16]! Added global and local session limits All of this needs TESTING. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2934 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/commands.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/commands.cpp') diff --git a/src/commands.cpp b/src/commands.cpp index e9b921beb..37f1fcef2 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -119,7 +119,7 @@ void do_whois(userrec* user, userrec* dest,unsigned long signon, unsigned long i WriteServ(user->fd,"311 %s %s %s %s * :%s",user->nick, dest->nick, dest->ident, dest->dhost, dest->fullname); if ((user == dest) || (strchr(user->modes,'o'))) { - WriteServ(user->fd,"378 %s %s :is connecting from *@%s %s",user->nick, dest->nick, dest->host, dest->ip); + WriteServ(user->fd,"378 %s %s :is connecting from *@%s %s",user->nick, dest->nick, dest->host, (char*)inet_ntoa(dest->ip4)); } std::string cl = chlist(dest,user); if (cl.length()) @@ -309,7 +309,7 @@ bool ip_matches_everyone(std::string ip, userrec* user) long matches = 0; for (user_hash::iterator u = clientlist.begin(); u != clientlist.end(); u++) { - if (match(u->second->ip,ip.c_str())) + if (match((char*)inet_ntoa(u->second->ip4),ip.c_str())) matches++; } float percent = ((float)matches / (float)clientlist.size()) * 100; -- cgit v1.3.1-10-gc9f91