1
0
mirror of https://github.com/anope/anope.git synced 2026-07-03 07:33:14 +02:00

Support DNS ANY query type

This commit is contained in:
Adam
2013-08-10 23:28:58 -04:00
parent c507c78d5a
commit c7aab50bff
3 changed files with 9 additions and 7 deletions
+1 -1
View File
@@ -293,7 +293,7 @@ command { service = "OperServ"; name = "CHANKILL"; command = "operserv/chankill"
*
* Finally set a NS record for irc.example.com. to BIND or services.
*/
module
#module
{
name = "os_dns"
+3 -1
View File
@@ -34,7 +34,9 @@ namespace DNS
/* IPv6 AAAA lookup */
QUERY_AAAA = 28,
/* Zone transfer */
QUERY_AXFR = 252
QUERY_AXFR = 252,
/* A lookup for any record */
QUERY_ANY = 255
};
/** Flags that can be AND'd into DNSPacket::flags to receive certain values
+5 -5
View File
@@ -774,7 +774,7 @@ class ModuleDNS : public Module
return;
/* Currently we reply to any QR for A/AAAA */
const DNS::Question& q = req.questions[0];
if (q.type != DNS::QUERY_A && q.type != DNS::QUERY_AAAA && q.type != DNS::QUERY_AXFR)
if (q.type != DNS::QUERY_A && q.type != DNS::QUERY_AAAA && q.type != DNS::QUERY_AXFR && q.type != DNS::QUERY_ANY)
return;
DNSZone *zone = DNSZone::Find(q.name);
@@ -791,7 +791,7 @@ class ModuleDNS : public Module
{
DNS::QueryType q_type = s->GetIPs()[j].find(':') != Anope::string::npos ? DNS::QUERY_AAAA : DNS::QUERY_A;
if (q.type == DNS::QUERY_AXFR || q_type == q.type)
if (q.type == DNS::QUERY_AXFR || q.type == DNS::QUERY_ANY || q_type == q.type)
{
DNS::ResourceRecord rr(q.name, q_type);
rr.ttl = this->ttl;
@@ -815,7 +815,7 @@ class ModuleDNS : public Module
{
DNS::QueryType q_type = s->GetIPs()[j].find(':') != Anope::string::npos ? DNS::QUERY_AAAA : DNS::QUERY_A;
if (q.type == DNS::QUERY_AXFR || q_type == q.type)
if (q.type == DNS::QUERY_AXFR || q.type == DNS::QUERY_ANY || q_type == q.type)
{
DNS::ResourceRecord rr(q.name, q_type);
rr.ttl = this->ttl;
@@ -844,7 +844,7 @@ class ModuleDNS : public Module
{
DNS::QueryType q_type = s->GetIPs()[j].find(':') != Anope::string::npos ? DNS::QUERY_AAAA : DNS::QUERY_A;
if (q.type == DNS::QUERY_AXFR || q_type == q.type)
if (q.type == DNS::QUERY_AXFR || q.type == DNS::QUERY_ANY || q_type == q.type)
{
DNS::ResourceRecord rr(q.name, q_type);
rr.ttl = this->ttl;
@@ -856,7 +856,7 @@ class ModuleDNS : public Module
if (packet->answers.size() == answer_size)
{
Log(this) << "Error! There are no servers with any IPs. At all.";
Log(this) << "Error! There are no servers with any IPs of type " << q.type;
/* Send back an empty answer anyway */
}
}