summaryrefslogtreecommitdiff
path: root/src/modules/m_cgiirc.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-01 15:07:11 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-01 15:07:11 +0000
commit5f4095e595fe36c6f83df96b7c59cb459b966ed3 (patch)
tree868b4a7d1f9bfcf3b85d9679fd7cbe48c6cc2005 /src/modules/m_cgiirc.cpp
parenta64a4665e0a2898ec08cf5996bdbf63c2567310e (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_cgiirc.cpp')
-rw-r--r--src/modules/m_cgiirc.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp
index 580060464..048f8bde0 100644
--- a/src/modules/m_cgiirc.cpp
+++ b/src/modules/m_cgiirc.cpp
@@ -117,7 +117,7 @@ class CGIResolver : public Resolver
them->host.assign(result,0, 64);
them->dhost.assign(result, 0, 64);
if (querytype)
- them->SetSockAddr(them->GetProtocolFamily(), result.c_str(), them->GetPort());
+ them->SetSockAddr(result.c_str(), them->GetPort());
them->ident.assign("~cgiirc", 0, 8);
them->InvalidateCache();
them->CheckLines(true);
@@ -318,7 +318,7 @@ public:
if(user->GetExt("cgiirc_webirc_ip", webirc_ip))
{
ServerInstance->Users->RemoveCloneCounts(user);
- user->SetSockAddr(user->GetProtocolFamily(), webirc_ip->c_str(), user->GetPort());
+ user->SetSockAddr(webirc_ip->c_str(), user->GetPort());
delete webirc_ip;
user->InvalidateCache();
user->Shrink("cgiirc_webirc_ip");
@@ -342,10 +342,10 @@ public:
bool valid = false;
ServerInstance->Users->RemoveCloneCounts(user);
#ifdef IPV6
- if (user->GetProtocolFamily() == AF_INET6)
- valid = (inet_pton(AF_INET6, user->password.c_str(), &((sockaddr_in6*)user->ip)->sin6_addr) > 0);
+ if (user->ip.sa.sa_family == AF_INET6)
+ valid = (inet_pton(AF_INET6, user->password.c_str(), &user->ip.in6.sin6_addr) > 0);
else
- valid = (inet_aton(user->password.c_str(), &((sockaddr_in*)user->ip)->sin_addr));
+ valid = (inet_aton(user->password.c_str(), &user->ip.in4.sin_addr));
#else
if (inet_aton(user->password.c_str(), &((sockaddr_in*)user->ip)->sin_addr))
valid = true;
@@ -407,7 +407,7 @@ public:
user->Extend("cgiirc_realhost", new std::string(user->host));
user->Extend("cgiirc_realip", new std::string(user->GetIPString()));
ServerInstance->Users->RemoveCloneCounts(user);
- user->SetSockAddr(user->GetProtocolFamily(), newip, user->GetPort());
+ user->SetSockAddr(newip, user->GetPort());
ServerInstance->Users->AddLocalClone(user);
ServerInstance->Users->AddGlobalClone(user);
user->CheckClass();