uint8_t labels_buf[LabelSequence::MAX_SERIALIZED_LENGTH];
const LabelSequence origin_ls(zone_data_.getOriginNode()->
getAbsoluteLabels(labels_buf));
- const LabelSequence name_ls(name);
+ LabelSequence name_ls(name);
if (!zone_data_.isNSEC3Signed()) {
isc_throw(DataSourceError,
// Examine all names from the query name to the origin name, stripping
// the deepest label one by one, until we find a name that has a matching
// NSEC3 hash.
- for (unsigned int labels = qlabels; labels >= olabels; --labels) {
- const Name& hname = (labels == qlabels ?
- name : name.split(qlabels - labels, labels));
- const std::string hlabel = hash->calculate(hname);
+ for (unsigned int labels = qlabels; labels >= olabels;
+ --labels, name_ls.stripLeft(1)) {
+ const std::string hlabel = hash->calculate(name_ls);
LOG_DEBUG(logger, DBG_TRACE_BASIC, DATASRC_MEMORY_FINDNSEC3_TRYHASH).
arg(name).arg(labels).arg(hlabel);