]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Expand the usage of set_ttl() before mark_header_ancient()
authorOndřej Surý <ondrej@isc.org>
Mon, 3 Feb 2025 14:02:40 +0000 (15:02 +0100)
committerOndřej Surý <ondrej@isc.org>
Mon, 3 Feb 2025 14:12:59 +0000 (15:12 +0100)
When the mark_header_ancient() helper function was introduced, couple of
places with duplicate (or almost duplicate) code was missed.  Add
missing set_ttl() calls before mark_header_ancient(), so the handling of
expiring headers is same in all places.

(concept cherry picked from commit 58179e6a192998a49732df57847091e42c654f0b)

lib/dns/rbtdb.c

index 87ef54fb2583639b7a1633738e75cae680fed3ad..572c55e2cc0a5e65cf1f81e4cc53eae733608047 100644 (file)
@@ -4690,6 +4690,7 @@ check_stale_header(dns_rbtnode_t *node, rdatasetheader_t *header,
                                }
                                free_rdataset(search->rbtdb, mctx, header);
                        } else {
+                               set_ttl(search->rbtdb, header, 0);
                                mark_header_ancient(search->rbtdb, header);
                                *header_prev = header;
                        }
@@ -5744,6 +5745,7 @@ expirenode(dns_db_t *db, dns_dbnode_t *node, isc_stdtime_t now) {
                         * refcurrent(rbtnode) must be non-zero.  This is so
                         * because 'node' is an argument to the function.
                         */
+                       set_ttl(rbtdb, header, 0);
                        mark_header_ancient(rbtdb, header);
                        if (log) {
                                isc_log_write(dns_lctx, category, module, level,
@@ -6035,6 +6037,7 @@ cache_findrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
                                 * non-zero.  This is so because 'node' is an
                                 * argument to the function.
                                 */
+                               set_ttl(rbtdb, header, 0);
                                mark_header_ancient(rbtdb, header);
                        }
                } else if (EXISTS(header) && !ANCIENT(header)) {