From: Vladimír Čunát Date: Fri, 29 Mar 2019 19:16:31 +0000 (+0100) Subject: cache: fix incorrect TTL of positive packets in cache X-Git-Tag: v4.0.0~10^2~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb40d0a08c04ab022ad9f1ce305d8b184407d95a;p=thirdparty%2Fknot-resolver.git cache: fix incorrect TTL of positive packets in cache 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. --- diff --git a/lib/cache/entry_pkt.c b/lib/cache/entry_pkt.c index 34562c454..b957a6028 100644 --- a/lib/cache/entry_pkt.c +++ b/lib/cache/entry_pkt.c @@ -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). */