diff options
author | Attila Molnar <attilamolnar@hush.com> | 2015-04-27 19:28:00 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2015-04-27 19:28:00 +0200 |
commit | 3d32852e7e459d403179e8f79354e2e52bbc4a52 (patch) | |
tree | 2f458123c58f9a60b0defcddef15d183374ece2a /src | |
parent | ee10c33eba66d20d6471d81b5f4e3484db30cfe6 (diff) |
core_dns Drop incoming packets containing a different question from what we asked
Diffstat (limited to 'src')
-rw-r--r-- | src/coremods/core_dns.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/coremods/core_dns.cpp b/src/coremods/core_dns.cpp index f4f85e253..d4214b9a5 100644 --- a/src/coremods/core_dns.cpp +++ b/src/coremods/core_dns.cpp @@ -527,6 +527,13 @@ class MyManager : public Manager, public Timer, public EventHandler return; } + if (static_cast<Question&>(*request) != recv_packet.question) + { + // This can happen under high latency, drop it silently, do not fail the request + ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Received an answer that isn't for a question we asked"); + return; + } + if (recv_packet.flags & QUERYFLAGS_OPCODE) { ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Received a nonstandard query"); |