From 1ac8c54574d2d68674ce0f3a5b15dce5d330049b Mon Sep 17 00:00:00 2001 From: Daniel De Graaf Date: Mon, 26 Apr 2010 18:38:11 -0500 Subject: Add debug output for received DNS packets --- src/dns.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/dns.cpp') diff --git a/src/dns.cpp b/src/dns.cpp index aec1cf45a..ef9ac12bf 100644 --- a/src/dns.cpp +++ b/src/dns.cpp @@ -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,""); } @@ -579,6 +580,8 @@ DNSResult DNS::GetResult() */ if (memcmp(&from, &myserver, sizeof(irc::sockets::sockaddrs))) { + 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 -- cgit v1.2.3