summaryrefslogtreecommitdiff
path: root/src/users.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-04 10:30:31 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-04 10:30:31 +0000
commit58478434810b5b7a2bdcde1cdf852e1c76907d6b (patch)
treec869cb3c79c66ff9bb0042b5af8167a9830eeaad /src/users.cpp
parentf25755bbe748f65eb17f8e25507160569f8f4041 (diff)
IPV6 changes for userrec::ip
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4695 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/users.cpp')
-rw-r--r--src/users.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/users.cpp b/src/users.cpp
index 258bb725a..85d64d462 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -809,7 +809,7 @@ void AddClient(int socket, int port, bool iscached, insp_inaddr ip)
_new->registered = REG_NONE;
_new->signon = TIME + Config->dns_timeout;
_new->lastping = 1;
- _new->SetSockAddr(AF_FAMILY, inet_ntoa(ip), port);
+ _new->SetSockAddr(AF_FAMILY, ipaddr, port);
// set the registration timeout for this user
unsigned long class_regtimeout = 90;
@@ -899,8 +899,8 @@ long FindMatchingGlobal(userrec* user)
/* I dont think theres any faster way of matching two ipv6 addresses than memcmp
* Let me know if you think of one.
*/
- in6_addr* s1 = &(((sockaddr_in*)&a->second->ip)->sin6_addr);
- in6_addr* s2 = &(((sockaddr_in*)&user->ip)->sin6_addr);
+ in6_addr* s1 = &(((sockaddr_in6*)&a->second->ip)->sin6_addr);
+ in6_addr* s2 = &(((sockaddr_in6*)&user->ip)->sin6_addr);
if (!memcmp(s1->s6_addr, s2->s6_addr, sizeof(in6_addr)))
x++;
#else
@@ -921,8 +921,8 @@ long FindMatchingLocal(userrec* user)
userrec* comp = *a;
#ifdef IPV6
/* I dont think theres any faster way of matching two ipv6 addresses than memcmp */
- in6_addr* s1 = &(((sockaddr_in*)&comp->ip)->sin6_addr);
- in6_addr* s2 = &(((sockaddr_in*)&user->ip)->sin6_addr);
+ in6_addr* s1 = &(((sockaddr_in6*)&comp->ip)->sin6_addr);
+ in6_addr* s2 = &(((sockaddr_in6*)&user->ip)->sin6_addr);
if (!memcmp(s1->s6_addr, s2->s6_addr, sizeof(in6_addr)))
x++;
#else