summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-11-01 20:20:12 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-11-01 20:20:12 +0000
commit11e2a5c8a1b4b8da2c72cbd44facac2128b8fd7b (patch)
tree9997c0a42e1db5a222cd90c7462db14e8e35a108 /src
parent622a6b263a6c180bf9d1301efc2cb9378f743f11 (diff)
Remove now-unneeded 4in6 hacks [danieldg]
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10781 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_cloaking.cpp11
-rw-r--r--src/modules/m_dnsbl.cpp21
-rw-r--r--src/users.cpp8
3 files changed, 6 insertions, 34 deletions
diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp
index 58de93da9..a5e3773e4 100644
--- a/src/modules/m_cloaking.cpp
+++ b/src/modules/m_cloaking.cpp
@@ -160,11 +160,6 @@ class CloakUser : public ModeHandler
std::string Cloak6(const char* ip)
{
- /* Theyre using 4in6 (YUCK). Translate as ipv4 cloak */
- if (!strncmp(ip, "0::ffff:", 8))
- return Cloak4(ip + 8);
-
- /* If we get here, yes it really is an ipv6 ip */
unsigned int iv[] = { key1, key2, key3, key4 };
std::vector<std::string> hashies;
std::string item;
@@ -418,10 +413,8 @@ 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) &&
- (inet_aton(dest->host.c_str(),&testaddr2) < 1) && (hostcloak.length() <= 64))
- /* Invalid ipv4/ipv6 address, and ipv6 user (resolved host) */
+ if ((dest->GetProtocolFamily() == 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))
/* Invalid ipv4 address, and ipv4 user (resolved host) */
diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp
index 524cab58d..0c3c2df7d 100644
--- a/src/modules/m_dnsbl.cpp
+++ b/src/modules/m_dnsbl.cpp
@@ -312,26 +312,9 @@ class ModuleDNSBL : public Module
unsigned char a, b, c, d;
char reversedipbuf[128];
std::string reversedip;
- bool success = false;
+ bool success;
- if (!inet_aton(user->GetIPString(), &in))
- {
-#ifdef IPV6
- /* We could have an ipv6 address here */
- std::string x = user->GetIPString();
- /* Is it a 4in6 address? (Compensate for this kernel kludge that people love) */
- if (x.find("0::ffff:") == 0)
- {
- x.erase(x.begin(), x.begin() + 8);
- if (inet_aton(x.c_str(), &in))
- success = true;
- }
-#endif
- }
- else
- {
- success = true;
- }
+ success = inet_aton(user->GetIPString(), &in);
if (!success)
return 0;
diff --git a/src/users.cpp b/src/users.cpp
index c6f5e498f..848f2a1eb 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -1254,12 +1254,8 @@ const char* User::GetIPString()
/* IP addresses starting with a : on irc are a Bad Thing (tm) */
if (*buf == ':')
{
- if (!strncmp(buf, "::ffff:", 7) && isdigit(buf[7])) {
- strlcpy(temp, buf+7, sizeof(temp) - 1);
- } else {
- strlcpy(&temp[1], buf, sizeof(temp) - 1);
- *temp = '0';
- }
+ strlcpy(&temp[1], buf, sizeof(temp) - 1);
+ *temp = '0';
this->cachedip = temp;
return temp;
}