]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2562] set want_answer to true in group_sendmsg() for notify handling.
authorJINMEI Tatuya <jinmei@isc.org>
Thu, 28 Mar 2013 02:48:37 +0000 (19:48 -0700)
committerJINMEI Tatuya <jinmei@isc.org>
Thu, 28 Mar 2013 02:48:37 +0000 (19:48 -0700)
without this we can't catch the case where zonemgr isn't running timely.
a unit test is updated to check that condition, too.

src/bin/auth/auth_srv.cc
src/bin/auth/tests/auth_srv_unittest.cc

index 5613f3a1cfbe24ec2242a8739f3aece1e13b319c..3fe9b9c6c4d3ae9b6f7f092ac880bdd1e9199ec2 100644 (file)
@@ -22,6 +22,7 @@
 #include <config/ccsession.h>
 
 #include <cc/data.h>
+#include <cc/proto_defs.h>
 
 #include <exceptions/exceptions.h>
 
@@ -813,7 +814,8 @@ AuthSrvImpl::processNotify(const IOMessage& io_message, Message& message,
                 command_template_end);
         const unsigned int seq =
             xfrin_session_->group_sendmsg(notify_command, "Zonemgr",
-                                          "*", "*");
+                                          CC_INSTANCE_WILDCARD,
+                                          CC_INSTANCE_WILDCARD, true);
         ConstElementPtr env, answer, parsed_answer;
         xfrin_session_->group_recvmsg(env, answer, false, seq);
         int rcode;
index a478f4b746559475e6485518c470f2f62f3a7987..8ca65fde87654a4c35ca522d9529865fa30e80ed 100644 (file)
@@ -26,6 +26,8 @@
 #include <dns/rdataclass.h>
 #include <dns/tsig.h>
 
+#include <cc/proto_defs.h>
+
 #include <server_common/portconfig.h>
 #include <server_common/keyring.h>
 
@@ -885,6 +887,9 @@ TEST_F(AuthSrvTest, notifyWithoutRecipient) {
     // happens.
     server.processMessage(*io_message, *parse_message, *response_obuffer,
                           &dnsserv);
+    // want_answer should have been set to true so auth can catch it if zonemgr
+    // is not running.
+    EXPECT_TRUE(notify_session.wasAnswerWanted());
     EXPECT_FALSE(dnsserv.hasAnswer());
 }