mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-11 12:50:00 -04:00
Add better ZEROTTL handling in bindrdataset()
If we know that the header has ZEROTTL set, the server should never send
stale records for it and the TTL should never be anything else than 0.
The comment was already there, but the code was not matching the
comment.
(cherry picked from commit cfee6aa565)
This commit is contained in:
parent
9a8483bece
commit
63e8af9270
1 changed files with 2 additions and 1 deletions
|
|
@ -3136,7 +3136,7 @@ bind_rdataset(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node, rdatasetheader_t *header,
|
|||
* (these records should not be cached anyway).
|
||||
*/
|
||||
|
||||
if (KEEPSTALE(rbtdb) && stale_ttl > now) {
|
||||
if (!ZEROTTL(header) && KEEPSTALE(rbtdb) && stale_ttl > now) {
|
||||
stale = true;
|
||||
} else {
|
||||
/*
|
||||
|
|
@ -3152,6 +3152,7 @@ bind_rdataset(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node, rdatasetheader_t *header,
|
|||
rdataset->type = RBTDB_RDATATYPE_BASE(header->type);
|
||||
rdataset->covers = RBTDB_RDATATYPE_EXT(header->type);
|
||||
rdataset->ttl = header->rdh_ttl - now;
|
||||
rdataset->ttl = !ZEROTTL(header) ? header->rdh_ttl - now : 0;
|
||||
rdataset->trust = header->trust;
|
||||
|
||||
if (NEGATIVE(header)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue