From: Mukund Sivaraman Date: Tue, 14 Jan 2014 15:35:38 +0000 (+0530) Subject: [2299] Use the shortcut DomainTree::find() for finding wildcard X-Git-Tag: bind10-1.2.0beta1-release~68^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1389ed4357607c17fb2ceb47731841b25e3e876d;p=thirdparty%2Fkea.git [2299] Use the shortcut DomainTree::find() for finding wildcard --- diff --git a/src/lib/datasrc/memory/zone_finder.cc b/src/lib/datasrc/memory/zone_finder.cc index a6c601b957..bf0ec4e171 100644 --- a/src/lib/datasrc/memory/zone_finder.cc +++ b/src/lib/datasrc/memory/zone_finder.cc @@ -523,21 +523,13 @@ FindNodeResult findNode(const ZoneData& zone_data, return (FindNodeResult(ZoneFinder::NXDOMAIN, nsec_rrset.first, nsec_rrset.second)); } - uint8_t ls_buf[LabelSequence::MAX_SERIALIZED_LENGTH]; - - // Create the wildcard name (i.e. take "*" and extend it - // with all node labels down to the wildcard node - LabelSequence wildcard_ls(LabelSequence::WILDCARD(), ls_buf); - const ZoneNode* extend_with = node; - while (extend_with != NULL) { - wildcard_ls.extend(extend_with->getLabels(), ls_buf); - extend_with = extend_with->getUpperNode(); - } - // Clear the node_path so that we don't keep incorrect (NSEC) - // context - node_path.clear(); - ZoneTree::Result result = tree.find(wildcard_ls, &node, node_path, + // Pass the wildcard label sequence ("*") (which is + // non-absolute) and the previous node_path result to this + // special shortcut form of find() that searches below from + // the node_path. + ZoneTree::Result result = tree.find(LabelSequence::WILDCARD(), + &node, node_path, cutCallback, &state); // Otherwise, why would the domain_flag::WILD be there if // there was no wildcard under it?