summaryrefslogtreecommitdiff
path: root/src/dns.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-03 21:45:39 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-03 21:45:39 +0000
commite5843dde4dda51de3160de62b7b8811cb9465d1b (patch)
treeca8ba9b01dfaf3f47fc2ed810fed63bf8a19cb88 /src/dns.cpp
parent0f5ba908f48029bdb27a08121469ab490c971bc6 (diff)
Add proper support for "munging" of ipv6 addresses when ::ffff:addr is used (this is temporary)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4693 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/dns.cpp')
-rw-r--r--src/dns.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/dns.cpp b/src/dns.cpp
index 907ded7f2..42db21424 100644
--- a/src/dns.cpp
+++ b/src/dns.cpp
@@ -257,11 +257,16 @@ DNS::DNS()
if (insp_aton(Config->DNSServer,&addr) > 0)
{
memcpy(&myserver,&addr,sizeof(insp_inaddr));
- if (strstr(Config->DNSServer,"::ffff:") == (char*)&Config->DNSServer)
+ if ((strstr(Config->DNSServer,"::ffff:") == (char*)&Config->DNSServer) || (strstr(Config->DNSServer,"::FFFF:") == (char*)&Config->DNSServer))
{
- /* These dont come back looking like they did when they went in. Reformat them */
- log(DEBUG,"Munging dns server name");
- strcpy(Config->DNSServer,insp_ntoa(myserver));
+ /* These dont come back looking like they did when they went in.
+ * We're forced to turn some checks off.
+ * If anyone knows how to fix this, let me know. --Brain
+ */
+ log(DEFAULT,"WARNING: Using IPv4 addresses over IPv6 forces some DNS checks to be disabled.");
+ log(DEFAULT," This should not cause a problem, however it is recommended you migrate");
+ log(DEFAULT," to a true IPv6 environment.");
+ this->ip6munge = true;
}
log(DEBUG,"Added nameserver '%s'",Config->DNSServer);
}
@@ -547,7 +552,7 @@ DNSResult DNS::GetResult()
/* We cant perform this security check if you're using 4in6.
* Tough luck to you, choose one or't other!
*/
- if (strstr(Config->DNSServer,"::ffff:") != (char*)&Config->DNSServer)
+ if (!ip6munge)
{
if ((port_from != DNS::QUERY_PORT) || (strcasecmp(ipaddr_from, Config->DNSServer)))
{