1
0
mirror of https://github.com/anope/anope.git synced 2026-07-08 20:23:11 +02:00

dns: set error to REFUSED when there are no answers

This commit is contained in:
Adam
2016-11-03 23:15:07 -04:00
parent 304494322f
commit ef32505633
2 changed files with 3 additions and 1 deletions
-1
View File
@@ -940,7 +940,6 @@ class ModuleDNS : public Module
if (packet->answers.size() == answer_size)
{
Log(this) << "Error! There are no servers with any IPs of type " << q.type;
/* Send back an empty answer anyway */
}
}
}
+3
View File
@@ -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;
}