diff options
author | Adam <Adam@anope.org> | 2012-12-25 01:09:03 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2012-12-25 01:09:03 -0500 |
commit | d4e1c958e27596af44db9be9046528f6d9116312 (patch) | |
tree | 0cdb42b622a9bd4dc211cfdd8725444a752eb0b5 /modules/commands/os_dns.cpp | |
parent | 33ae442aa15453d2d6ddb53020db7eecdd74ba53 (diff) |
packet->answers isnt always empty initially, like with axfrs
Diffstat (limited to 'modules/commands/os_dns.cpp')
-rw-r--r-- | modules/commands/os_dns.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/commands/os_dns.cpp b/modules/commands/os_dns.cpp index cc1928b64..714203c59 100644 --- a/modules/commands/os_dns.cpp +++ b/modules/commands/os_dns.cpp @@ -765,6 +765,7 @@ class ModuleDNS : public Module return; DNSZone *zone = DNSZone::Find(q.name); + size_t answer_size = packet->answers.size(); if (zone) { for (std::set<Anope::string, ci::less>::iterator it = zone->servers.begin(), it_end = zone->servers.end(); it != it_end; ++it) @@ -788,7 +789,7 @@ class ModuleDNS : public Module } } - if (packet->answers.empty()) + if (packet->answers.size() == answer_size) { /* Default zone */ for (unsigned i = 0; i < dns_servers.size(); ++i) @@ -812,7 +813,7 @@ class ModuleDNS : public Module } } - if (packet->answers.empty()) + if (packet->answers.size() == answer_size) { static time_t last_warn = 0; if (last_warn + 60 < Anope::CurTime) @@ -840,7 +841,7 @@ class ModuleDNS : public Module } } - if (packet->answers.empty()) + if (packet->answers.size() == answer_size) { Log(this) << "Error! There are no servers with any IPs. At all."; /* Send back an empty answer anyway */ |