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:
@@ -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 */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user