From 0f5ba908f48029bdb27a08121469ab490c971bc6 Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 3 Aug 2006 21:37:01 +0000 Subject: Change some checking git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4692 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/dns.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/dns.cpp b/src/dns.cpp index 6013a60eb..907ded7f2 100644 --- a/src/dns.cpp +++ b/src/dns.cpp @@ -544,10 +544,16 @@ DNSResult DNS::GetResult() port_from = ntohs(((sockaddr_in*)&from)->sin_port); #endif - if ((port_from != DNS::QUERY_PORT) || (strcasecmp(ipaddr_from, Config->DNSServer))) + /* 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) { - log(DEBUG,"port %d is not 53, or %s is not %s",port_from, ipaddr_from, Config->DNSServer); - return std::make_pair(-1,""); + if ((port_from != DNS::QUERY_PORT) || (strcasecmp(ipaddr_from, Config->DNSServer))) + { + log(DEBUG,"port %d is not 53, or %s is not %s",port_from, ipaddr_from, Config->DNSServer); + return std::make_pair(-1,""); + } } /* Put the read header info into a header class */ -- cgit v1.2.3