summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel De Graaf <danieldg@inspircd.org>2010-04-26 18:38:11 -0500
committerDaniel De Graaf <danieldg@inspircd.org>2010-04-26 18:38:51 -0500
commit1ac8c54574d2d68674ce0f3a5b15dce5d330049b (patch)
tree490cc27ea7e8173ca918ad2d9139c77270c6060d
parent49313a2b5a5d8ba76ecb1ab2ed9f3df94639f7bb (diff)
Add debug output for received DNS packets
-rw-r--r--src/dns.cpp4
1 files changed, 4 insertions, 0 deletions
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