]> 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:30:28 +0000 (10:30 +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 f01231d41a97975aa82f7b909e7983fa6735c7c5..9a25a4cda77255453d6b07ee6c96627dc017f62c 100644 (file)
@@ -6472,7 +6472,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;
                }
 
@@ -6533,7 +6533,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;