]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
clear kr_query::flags.CACHED
authorVladimír Čunát <vladimir.cunat@nic.cz>
Fri, 26 Mar 2021 10:58:42 +0000 (11:58 +0100)
committerTomas Krizek <tomas.krizek@nic.cz>
Wed, 31 Mar 2021 15:41:52 +0000 (17:41 +0200)
I suspect there's an edge case where cache thinks it provided enough
data but iterator (or who) disagrees and resolution continues.
We observed (flags.CACHED == true) even when processing a reply from
internet, and that could be confusing and even trigger a segfault.
Clearing the flag sounds OK semantically; it never meant that no cached
data have been used within the kr_query (e.g. zone cut, DS/DNSKEY, ...)

lib/layer/iterate.c

index 94342cfb510eccdf09d31ef3b76c09c33ea34512..65fce45da0f6b8f875e64a19a171e7302b3e27b8 100644 (file)
@@ -963,6 +963,7 @@ static int prepare_query(kr_layer_t *ctx, knot_pkt_t *pkt)
 
        query->uid = req->rplan.next_uid;
        req->rplan.next_uid += 1;
+       query->flags.CACHED = false; // in case it got left from earlier (unknown edge case)
 
        return KR_STATE_CONSUME;
 }