Skip to content
Snippets Groups Projects
Commit 8d212ce3 authored by Grigorii Demidov's avatar Grigorii Demidov
Browse files

layer/iterate: some additional processing for referrals

parent 0280c7ce
Branches
Tags
2 merge requests!254Knot Resolver 1.2.5,!204layer/iterate: some additional processing for referrals
Pipeline #1757 passed with stages
in 1 minute and 15 seconds
......@@ -471,6 +471,18 @@ static int process_referral_answer(knot_pkt_t *pkt, struct kr_request *req)
if (state != kr_ok()) {
return KR_STATE_FAIL;
}
struct kr_query *query = req->current_query;
if (!(query->flags & QUERY_CACHED)) {
/* If not cached (i.e. got from upstream)
* make sure that this is not an authoritative answer
* (even with AA=1) for other layers.
* There can be answers with AA=1,
* empty answer section and NS in authority.
* Clearing of AA prevents them from
* caching in the packet cache.
* If packet already cached, don't touch him. */
knot_wire_clear_aa(pkt->wire);
}
state = pick_authority(pkt, req, false);
return state == kr_ok() ? KR_STATE_DONE : KR_STATE_FAIL;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment