]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/dns.cpp
2.0.1 release
[user/henk/code/inspircd.git] / src / dns.cpp
index aec1cf45a69a3c9055eaf3b5898846cbfb72da7d..945e1fb15c296577fce48a7c017fba18c0624f9d 100644 (file)
@@ -564,6 +564,7 @@ DNSResult DNS::GetResult()
        /* Did we get the whole header? */
        if (length < 12)
        {
+               ServerInstance->Logs->Log("RESOLVER",DEBUG,"GetResult didn't get a full packet (len=%d)", length);
                /* Nope - something screwed up. */
                return DNSResult(-1,"",0,"");
        }
@@ -577,8 +578,10 @@ DNSResult DNS::GetResult()
         *
         * -- Thanks jilles for pointing this one out.
         */
-       if (memcmp(&from, &myserver, sizeof(irc::sockets::sockaddrs)))
+       if (from != myserver)
        {
+               ServerInstance->Logs->Log("RESOLVER",DEBUG,"Got a result from the wrong server! Bad NAT or DNS forging attempt? '%s' != '%s'",
+                       from.str().c_str(), myserver.str().c_str());
                return DNSResult(-1,"",0,"");
        }
 
@@ -595,6 +598,7 @@ DNSResult DNS::GetResult()
        if (!requests[this_id])
        {
                /* Somehow we got a DNS response for a request we never made... */
+               ServerInstance->Logs->Log("RESOLVER",DEBUG,"Hmm, got a result that we didn't ask for (id=%lx). Ignoring.", this_id);
                return DNSResult(-1,"",0,"");
        }
        else