Browse Source

update reply message AA bit logic

git-svn-id: svn://bind10.isc.org/svn/bind10/branches/trac439@3975 e5f2f494-b856-4b98-b285-d166d9295462
Jerry 14 years ago
parent
commit
5b25a47dcf
2 changed files with 5 additions and 2 deletions
  1. 4 1
      src/bin/auth/query.cc
  2. 1 1
      src/bin/auth/tests/auth_srv_unittest.cc

+ 4 - 1
src/bin/auth/query.cc

@@ -27,9 +27,10 @@ namespace auth {
 
 void
 Query::process() const {
+    bool keep_doing = true;
+    response_.setHeaderFlag(Message::HEADERFLAG_AA, false);
     const MemoryDataSrc::FindResult result =
         memory_datasrc_.findZone(qname_);
-    bool keep_doing = true;
 
     if (result.code != result::SUCCESS &&
         result.code != result::PARTIALMATCH) {
@@ -37,6 +38,8 @@ Query::process() const {
         return;
     }
 
+    // Found a zone which is the nearest ancestor to QNAME, set the AA bit
+    response_.setHeaderFlag(Message::HEADERFLAG_AA);
     while (keep_doing) {
         keep_doing = false;
         Zone::FindResult db_result = result.zone->find(qname_, qtype_);

+ 1 - 1
src/bin/auth/tests/auth_srv_unittest.cc

@@ -770,7 +770,7 @@ TEST_F(AuthSrvTest, useMemoryDataSrc) {
     EXPECT_TRUE(server.processMessage(*io_message, parse_message,
                                       response_renderer));
     headerCheck(parse_message, default_qid, Rcode::SERVFAIL(), opcode.getCode(),
-                QR_FLAG | AA_FLAG, 1, 0, 0, 0);
+                QR_FLAG, 1, 0, 0, 0);
 }
 
 TEST_F(AuthSrvTest, cacheSlots) {