]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Match prefetch eligibility behavior with ARM
authorAram Sargsyan <aram@isc.org>
Tue, 18 Oct 2022 12:59:47 +0000 (12:59 +0000)
committerAram Sargsyan <aram@isc.org>
Fri, 21 Oct 2022 10:22:29 +0000 (10:22 +0000)
ARM states that the "eligibility" TTL is the smallest original TTL
value that is accepted for a record to be eligible for prefetching,
but the code, which implements the condition doesn't behave in that
manner for the edge case when the TTL is equal to the configured
eligibility value.

Fix the code to check that the TTL is greater than, or equal to the
configured eligibility value, instead of just greater than it.

(cherry picked from commit 863f51466e1d0ab8ab7410132d21fb0b0a4ba168)

lib/dns/resolver.c

index 5d26ebd0ff576c9ed92bba8d26ab18f92c915ff1..655b6e01a2133456e360b700a6c1478f6f60aab0 100644 (file)
@@ -6252,7 +6252,7 @@ cache_name(fetchctx_t *fctx, dns_name_t *name, dns_message_t *message,
                /*
                 * Mark the rdataset as being prefetch eligible.
                 */
-               if (rdataset->ttl > fctx->res->view->prefetch_eligible) {
+               if (rdataset->ttl >= fctx->res->view->prefetch_eligible) {
                        rdataset->attributes |= DNS_RDATASETATTR_PREFETCH;
                }
 
@@ -6314,7 +6314,7 @@ cache_name(fetchctx_t *fctx, dns_name_t *name, dns_message_t *message,
                        /*
                         * Mark the rdataset as being prefetch eligible.
                         */
-                       if (rdataset->ttl > fctx->res->view->prefetch_eligible)
+                       if (rdataset->ttl >= fctx->res->view->prefetch_eligible)
                        {
                                rdataset->attributes |=
                                        DNS_RDATASETATTR_PREFETCH;