summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-02-07 19:41:42 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-02-07 19:41:42 +0000
commitb8af948ecd74a924d5d490aedbb35d49c1b242cd (patch)
treea4cd708c89b920871371ba774244f80b77bc972a /src/modules
parent7ac4fbe33b35cf42fbded97a2fdb4a5d9163f04b (diff)
Add InvalidateCache() calls and fix a ton of ass-u-me :/
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6539 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_cgiirc.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp
index 7e471652d..f7d14ecc7 100644
--- a/src/modules/m_cgiirc.cpp
+++ b/src/modules/m_cgiirc.cpp
@@ -237,7 +237,7 @@ public:
bool valid = false;
#ifdef IPV6
if (strchr(user->password,':'))
- valid = (inet_pton(user->password, &((sockaddr_in6*)&user->ip)->sin6_addr));
+ valid = (inet_pton(user->password, &((sockaddr_in6*)&user->ip)->sin6_addr) > 0);
else
valid = (inet_aton(user->password, &((sockaddr_in*)&user->ip)->sin_addr));
#else
@@ -300,10 +300,14 @@ public:
user->Extend("cgiirc_realhost", new std::string(user->host));
user->Extend("cgiirc_realip", new std::string(user->GetIPString()));
#ifdef IPV6
- insp_aton(newip, (insp_inaddr*)&((sockaddr_in6*)&user->ip)->sin6_addr);
+ if (strchr(user->password,':'))
+ inet_pton(newip, &((sockaddr_in6*)&user->ip)->sin6_addr);
+ else
+ inet_aton(newip, &((sockaddr_in*)&user->ip)->sin_addr);
#else
- insp_aton(newip, (insp_inaddr*)&((sockaddr_in*)&user->ip)->sin_addr);
+ inet_aton(newip, &((sockaddr_in*)&user->ip)->sin_addr);
#endif
+
try
{
@@ -316,6 +320,7 @@ public:
strlcpy(user->host, newip, 16);
strlcpy(user->dhost, newip, 16);
strlcpy(user->ident, "~cgiirc", 8);
+ user->InvalidateCache();
if(NotifyOpers)
ServerInstance->WriteOpers("*** Connecting user %s detected as using CGI:IRC (%s), but i could not resolve their hostname!", user->nick, user->host);