Skip to content

Commit

Permalink
rec: a single NSEC3 record covering everything is a special case
Browse files Browse the repository at this point in the history
Fixes PowerDNS#13542

(cherry picked from commit 257b23b)
  • Loading branch information
omoerbeek committed Feb 26, 2024
1 parent 06d5138 commit 8e2f28a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pdns/recursordist/aggressive_nsec.cc
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,10 @@ static bool commonPrefixIsLong(const string& one, const string& two, size_t boun
bool AggressiveNSECCache::isSmallCoveringNSEC3(const DNSName& owner, const std::string& nextHash)
{
std::string ownerHash(fromBase32Hex(owner.getRawLabel(0)));
// Special case: empty zone, so the single NSEC3 covers everything. Prefix is long but we still want it cached.
if (ownerHash == nextHash) {
return false;
}
return commonPrefixIsLong(ownerHash, nextHash, AggressiveNSECCache::s_maxNSEC3CommonPrefix);
}

Expand Down

0 comments on commit 8e2f28a

Please sign in to comment.