]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[1578] set RESULT_WILDCARD for the empty wild match case
authorJINMEI Tatuya <jinmei@isc.org>
Tue, 31 Jan 2012 23:02:44 +0000 (15:02 -0800)
committerJINMEI Tatuya <jinmei@isc.org>
Tue, 31 Jan 2012 23:02:44 +0000 (15:02 -0800)
src/lib/datasrc/memory_datasrc.cc
src/lib/datasrc/tests/memory_datasrc_unittest.cc

index 22864f8447b165ac3bcb6e444df405c208d16e1a..636a7355c496d54831bb0e133776b01a28f54e2d 100644 (file)
@@ -769,7 +769,7 @@ struct InMemoryZoneFinder::InMemoryZoneFinderImpl {
         if (node->isEmpty()) {
             LOG_DEBUG(logger, DBG_TRACE_DATA, DATASRC_MEM_DOMAIN_EMPTY).
                 arg(name);
-            return (FindResult(NXRRSET, ConstRRsetPtr()));
+            return (createFindResult(NXRRSET, ConstRRsetPtr(), rename));
         }
 
         Domain::const_iterator found;
index 7b75aa0a948152d9dc915c067ab97557a8122537..ae178cfd18cd6c54a362b10bfc6278fe3ff14ab1 100644 (file)
@@ -1011,7 +1011,8 @@ TEST_F(InMemoryZoneFinderTest, emptyWildcard) {
 
     {
         SCOPED_TRACE("Asking for A record");
-        findTest(Name("a.foo.example.org"), RRType::A(), ZoneFinder::NXRRSET);
+        findTest(Name("a.foo.example.org"), RRType::A(), ZoneFinder::NXRRSET,
+                 true, ConstRRsetPtr(), ZoneFinder::RESULT_WILDCARD);
         findTest(Name("*.foo.example.org"), RRType::A(), ZoneFinder::NXRRSET);
         findTest(Name("foo.example.org"), RRType::A(), ZoneFinder::NXRRSET);
     }
@@ -1026,7 +1027,8 @@ TEST_F(InMemoryZoneFinderTest, emptyWildcard) {
     {
         SCOPED_TRACE("Asking on the non-terminal");
         findTest(Name("wild.bar.foo.example.org"), RRType::A(),
-            ZoneFinder::NXRRSET);
+                 ZoneFinder::NXRRSET, true, ConstRRsetPtr(),
+                 ZoneFinder::RESULT_WILDCARD);
     }
 }
 
@@ -1052,7 +1054,8 @@ TEST_F(InMemoryZoneFinderTest, nestedEmptyWildcard) {
 
         for (const char** name = names; *name != NULL; ++ name) {
             SCOPED_TRACE(string("Node ") + *name);
-            findTest(Name(*name), RRType::A(), ZoneFinder::NXRRSET);
+            findTest(Name(*name), RRType::A(), ZoneFinder::NXRRSET, true,
+                     ConstRRsetPtr(), ZoneFinder::RESULT_WILDCARD);
         }
     }