summaryrefslogtreecommitdiff
path: root/modules/m_dns.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2016-11-03 23:15:07 -0400
committerAdam <Adam@anope.org>2016-11-03 23:15:07 -0400
commitef32505633ad40bd3937edfa739f6b13ecdda599 (patch)
tree5535f8138c6d77a2a9f70ae7a060e56f6e78b4ec /modules/m_dns.cpp
parent304494322fa515f1d6dc294e333329ca4731bd29 (diff)
dns: set error to REFUSED when there are no answers
Diffstat (limited to 'modules/m_dns.cpp')
-rw-r--r--modules/m_dns.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/m_dns.cpp b/modules/m_dns.cpp
index 93f09246e..4dc6d7bfa 100644
--- a/modules/m_dns.cpp
+++ b/modules/m_dns.cpp
@@ -854,6 +854,9 @@ class MyManager : public Manager, public Timer
}
}
+ if (packet->answers.empty() && packet->authorities.empty() && packet->additional.empty() && packet->error == ERROR_NONE)
+ packet->error = ERROR_REFUSED; // usually safe, won't cause an NXDOMAIN to get cached
+
s->Reply(packet);
return true;
}