]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
cache: fix incorrect TTL of positive packets in cache
authorVladimír Čunát <vladimir.cunat@nic.cz>
Fri, 29 Mar 2019 19:16:31 +0000 (20:16 +0100)
committerPetr Špaček <petr.spacek@nic.cz>
Thu, 11 Apr 2019 07:12:47 +0000 (09:12 +0200)
It's a regression of b00ee5fa8 (v3.0.0).  Fortunately, since that
version we use cache for positive packets only when they are BOGUS
(see `bool want_pkt =`) so that they're available for +cd queries.
Therefore the impact was really negligible, until the DoT module.

lib/cache/entry_pkt.c

index 34562c45429a4596a9152a74c03b81be6d692981..b957a6028fe54cb60d0515fa6f23af9ec4319ad3 100644 (file)
@@ -48,6 +48,7 @@ uint32_t packet_ttl(const knot_pkt_t *pkt, bool is_negative)
                                continue; /* Skip metatypes. */
                        }
                        ttl = MIN(ttl, rr->ttl);
+                       has_ttl = true;
                }
        }
        /* If no valid TTL present, go with zero (will get clamped to minimum). */