]> 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:19:23 +0000 (10:19 +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.

lib/dns/resolver.c

index cc552ea33ac684500f4d483ba4f70b695c7bd55a..42048d91073e53f6235e233400058cc80be4c1f8 100644 (file)
@@ -6179,7 +6179,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;
                }
 
@@ -6241,7 +6241,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;