Preserve ZEROTTL attribute when replacing NS RRset

Previously, BIND 9 would drop the ZEROTTL attribute when updating
previously cached NS entry with ZEROTTL attribute set.

Co-authored-by: Jinmei Tatuya <jtatuya@infoblox.com>
(cherry picked from commit 982ca161c2)
This commit is contained in:
Ondřej Surý 2025-08-26 17:52:45 +02:00
parent af551184e2
commit d4c4edff1f
No known key found for this signature in database
GPG key ID: 2820F37E873DEA41

View file

@ -6642,7 +6642,7 @@ find_header:
return ISC_R_SUCCESS;
}
/*
* If we have will be replacing a NS RRset force its TTL
* If we will be replacing a NS RRset force its TTL
* to be no more than the current NS RRset's TTL. This
* ensures the delegations that are withdrawn are honoured.
*/
@ -6651,6 +6651,11 @@ find_header:
!newheader_nx && header->trust <= newheader->trust)
{
if (newheader->rdh_ttl > header->rdh_ttl) {
if (ZEROTTL(header)) {
RDATASET_ATTR_SET(
newheader,
RDATASET_ATTR_ZEROTTL);
}
newheader->rdh_ttl = header->rdh_ttl;
}
}