diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-01 15:07:11 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-01 15:07:11 +0000 |
commit | 5f4095e595fe36c6f83df96b7c59cb459b966ed3 (patch) | |
tree | 868b4a7d1f9bfcf3b85d9679fd7cbe48c6cc2005 /src/modules/m_cloaking.cpp | |
parent | a64a4665e0a2898ec08cf5996bdbf63c2567310e (diff) |
Change IP address storage in User to use more IPv4/IPv6 common code
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11575 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_cloaking.cpp')
-rw-r--r-- | src/modules/m_cloaking.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp index 59dd008af..29a5e1421 100644 --- a/src/modules/m_cloaking.cpp +++ b/src/modules/m_cloaking.cpp @@ -413,10 +413,10 @@ class ModuleCloaking : public Module #ifdef IPV6 in6_addr testaddr; in_addr testaddr2; - if ((dest->GetProtocolFamily() == AF_INET6) && (inet_pton(AF_INET6,dest->host.c_str(),&testaddr) < 1) && (hostcloak.length() <= 64)) + if ((dest->ip.sa.sa_family == AF_INET6) && (inet_pton(AF_INET6,dest->host.c_str(),&testaddr) < 1) && (hostcloak.length() <= 64)) /* Invalid ipv6 address, and ipv6 user (resolved host) */ b = hostcloak; - else if ((dest->GetProtocolFamily() == AF_INET) && (inet_aton(dest->host.c_str(),&testaddr2) < 1) && (hostcloak.length() <= 64)) + else if ((dest->ip.sa.sa_family == AF_INET) && (inet_aton(dest->host.c_str(),&testaddr2) < 1) && (hostcloak.length() <= 64)) /* Invalid ipv4 address, and ipv4 user (resolved host) */ b = hostcloak; else @@ -435,10 +435,10 @@ class ModuleCloaking : public Module else { #ifdef IPV6 - if (dest->GetProtocolFamily() == AF_INET6) + if (dest->ip.sa.sa_family == AF_INET6) b = cu->Cloak6(dest->GetIPString()); + else #endif - if (dest->GetProtocolFamily() == AF_INET) b = cu->Cloak4(dest->GetIPString()); } |