summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-03 21:37:01 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-03 21:37:01 +0000
commit0f5ba908f48029bdb27a08121469ab490c971bc6 (patch)
treef8991de3a1a0e4804e6d02d959da67daac6aecdc
parentbbb04ecde25975beb81b7ab1010e21b39b8ddb9f (diff)
Change some checking
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4692 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/dns.cpp12
1 files 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 */