]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[1607] use the result of findZone() to check if qname is zone origin.
authorJINMEI Tatuya <jinmei@isc.org>
Fri, 2 Mar 2012 09:22:44 +0000 (01:22 -0800)
committerJINMEI Tatuya <jinmei@isc.org>
Fri, 2 Mar 2012 09:22:44 +0000 (01:22 -0800)
This should be more efficient than expensive name comparison.
This is a small (unrelated) optimization, but hopefully it's okay.

src/bin/auth/query.cc

index 59e3b7f9997368906e0eef24ac3e44701e83e10c..7d50393202c4c419348a75c4434d1c62e836a10c 100644 (file)
@@ -503,7 +503,9 @@ Query::process() {
             // section, insert apex NS records into the authority section
             // and AAAA/A RRS of each of the NS RDATA into the additional
             // section.
-            if (qname_ != result.zone_finder->getOrigin() ||
+            // Checking the findZone() is a lightweight check to see if
+            // qname is the zone origin.
+            if (result.code != result::SUCCESS ||
                 db_context->code != ZoneFinder::SUCCESS ||
                 (qtype_ != RRType::NS() && !qtype_is_any))
             {