From 1b67662bc821eb1d0edb2578fdc637193884f24c Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 5 Aug 2006 22:30:39 +0000 Subject: Extra stuff for identifying ipv6 addresses git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4726 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_cloaking.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp index b3aa8c0fa..717bbc436 100644 --- a/src/modules/m_cloaking.cpp +++ b/src/modules/m_cloaking.cpp @@ -304,15 +304,19 @@ class CloakUser : public ModeHandler * are connecting via localhost) -- this doesnt matter much. */ - if (strchr(dest->host,'.')) + if (strchr(dest->host,'.') || strchr(dest->host,':')) { /* InspIRCd users have two hostnames; A displayed * hostname which can be modified by modules (e.g. * to create vhosts, implement chghost, etc) and a * 'real' hostname which you shouldnt write to. */ - - std::string a = strstr(dest->host,"."); + + char* n = strstr(dest->host,"."); + if (!n) + n = strstr(dest->host,":"); + + std::string a = n; char ra[64]; this->GenHash(dest->host,ra); @@ -325,7 +329,7 @@ class CloakUser : public ModeHandler * Their ISP shouldnt go to town on subdomains, or they shouldnt have a kiddie * vhost. */ - + if ((insp_aton(dest->host,&testaddr) < 1) && (hostcloak.length() < 64)) { // if they have a hostname, make something appropriate -- cgit v1.2.3