summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-04 12:59:04 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-04 12:59:04 +0000
commit425e2a649005beb72a258ddde76b56b0ffd15e40 (patch)
tree21cccae6a27f93889e70cec6dc316480e5d2c1fe /src
parent32ea53d02e36c3fd4e9eef86cfea32c89fb75ede (diff)
More changes
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4702 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/users.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/users.cpp b/src/users.cpp
index fa0fd8d69..f5ceabf37 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -933,13 +933,13 @@ 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_in6*)&comp->ip)->sin6_addr);
- in6_addr* s2 = (((sockaddr_in6*)&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
- in_addr* s1 = ((sockaddr_in*)&comp->ip)->sin_addr;
- in_addr* s2 = ((sockaddr_in*)&user->ip)->sin_addr;
+ in_addr* s1 = &((sockaddr_in*)comp->ip)->sin_addr;
+ in_addr* s2 = &((sockaddr_in*)user->ip)->sin_addr;
if (s1->s_addr == s2->s_addr)
x++;
#endif
@@ -1158,14 +1158,14 @@ int userrec::GetPort()
#ifdef SUPPORT_IP6LINKS
case AF_INET6:
{
- sockaddr_in6* sin = (sockaddr_in6*)&this->ip;
+ sockaddr_in6* sin = (sockaddr_in6*)this->ip;
return sin->sin6_port;
}
break;
#endif
case AF_INET:
{
- sockaddr_in* sin = (sockaddr_in*)&this->ip;
+ sockaddr_in* sin = (sockaddr_in*)this->ip;
return sin->sin_port;
}
break;
@@ -1178,7 +1178,7 @@ int userrec::GetPort()
int userrec::GetProtocolFamily()
{
- sockaddr_in* sin = (sockaddr_in*)&this->ip;
+ sockaddr_in* sin = (sockaddr_in*)this->ip;
return sin->sin_family;
}
@@ -1191,7 +1191,7 @@ const char* userrec::GetIPString()
#ifdef SUPPORT_IP6LINKS
case AF_INET6:
{
- sockaddr_in6* sin = (sockaddr_in6*)&this->ip;
+ sockaddr_in6* sin = (sockaddr_in6*)this->ip;
inet_ntop(sin->sin6_family, &sin->sin6_addr, buf, sizeof(buf));
return buf;
}
@@ -1199,7 +1199,7 @@ const char* userrec::GetIPString()
#endif
case AF_INET:
{
- sockaddr_in* sin = (sockaddr_in*)&this->ip;
+ sockaddr_in* sin = (sockaddr_in*)this->ip;
inet_ntop(sin->sin_family, &sin->sin_addr, buf, sizeof(buf));
return buf;
}