}),
ret.end());
}
+ else {
+ pdns::dedupRecords(ret);
+ }
t_Counters.at(rec::Counter::dns64prefixanswers)++;
return rcode;
}
}
if (!ret.empty()) {
+#ifdef notyet
pdns::dedupRecords(ret);
+#endif
pdns::orderAndShuffle(ret, false);
if (auto listToSort = luaconfsLocal->sortlist.getOrderCmp(comboWriter->d_source)) {
stable_sort(ret.begin(), ret.end(), *listToSort);
// so you can't trust that a real lookup will have been made.
res = doResolve(newTarget, qtype, ret, depth + 1, beenthere, cnameContext);
LOG(prefix << qname << ": Updating validation state for response to " << qname << " from " << context.state << " with the state from the DNAME/CNAME quest: " << cnameContext.state << endl);
+ pdns::dedupRecords(ret); // multiple NSECS could have been added, #14120
updateValidationState(qname, context.state, cnameContext.state, prefix);
return true;
}
lwr.d_records = std::move(vec);
}
+#ifdef notyet
if (auto count = pdns::dedupRecords(lwr.d_records); count > 0) {
LOG(prefix << qname << ": Removed " << count << " duplicate records from response received from " << auth << endl);
}
+#endif
}
void SyncRes::rememberParentSetIfNeeded(const DNSName& domain, const vector<DNSRecord>& newRecords, unsigned int depth, const string& prefix)
addRecordToLW(res, "a.gtld-servers.com.", QType::A, "192.0.2.1", DNSResourceRecord::ADDITIONAL, 3600);
return LWResult::Result::Success;
}
+ // The code below introduces duplicate NSEC3 records
if (address == ComboAddress("192.0.2.1:53")) {
setLWResult(res, 0, true, false, true);
/* no data */
int res = sr->beginResolve(target, QType(QType::A), QClass::IN, ret);
BOOST_CHECK_EQUAL(res, RCode::NoError);
BOOST_CHECK_EQUAL(sr->getValidationState(), vState::Secure);
- /* the duplicated NSEC3 should have been dedupped */
- BOOST_REQUIRE_EQUAL(ret.size(), 8U);
+ /* the duplicated NSEC3 have not been dedupped */
+ BOOST_REQUIRE_EQUAL(ret.size(), 9U);
BOOST_CHECK_EQUAL(queriesCount, 4U);
/* again, to test the cache */
res = sr->beginResolve(target, QType(QType::A), QClass::IN, ret);
BOOST_CHECK_EQUAL(res, RCode::NoError);
BOOST_CHECK_EQUAL(sr->getValidationState(), vState::Secure);
- /* the duplicated NSEC3 should have been dedupped */
- BOOST_REQUIRE_EQUAL(ret.size(), 8U);
+ /* the duplicated NSEC3 have not been dedupped */
+ BOOST_REQUIRE_EQUAL(ret.size(), 9U);
BOOST_CHECK_EQUAL(queriesCount, 4U);
}