From: Vladimír Čunát Date: Thu, 13 Apr 2017 14:09:39 +0000 (+0200) Subject: misc nitpicks, not really changing anything X-Git-Tag: v1.3.0~23^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=377f5a815b402bef4cdac309c4b6fcf363ba10aa;p=thirdparty%2Fknot-resolver.git misc nitpicks, not really changing anything --- diff --git a/lib/layer/iterate.c b/lib/layer/iterate.c index 7e45e8a08..67ff7f177 100644 --- a/lib/layer/iterate.c +++ b/lib/layer/iterate.c @@ -291,7 +291,8 @@ static int update_cut(knot_pkt_t *pkt, const knot_rrset_t *rr, return state; } -/** Compute rank appropriate for RRs present in the packet. */ +/** Compute rank appropriate for RRs present in the packet. + * @param answer whether the RR is from answer or authority section */ static uint8_t get_initial_rank(const knot_rrset_t *rr, const struct kr_query *qry, const bool answer, const bool is_referral) { @@ -708,6 +709,9 @@ static int process_stub(knot_pkt_t *pkt, struct kr_request *req) const knot_rrset_t *rr = knot_pkt_rr(an, i); int err = kr_ranked_rrarray_add(&req->answ_selected, rr, KR_RANK_INITIAL | KR_RANK_AUTH, true, query->uid, &req->pool); + /* KR_RANK_AUTH: we don't have the records directly from + * an authoritative source, but we do trust the server and it's + * supposed to only send us authoritative records. */ if (err != kr_ok()) { return KR_STATE_FAIL; } diff --git a/lib/resolve.c b/lib/resolve.c index 21559213d..68b66922b 100644 --- a/lib/resolve.c +++ b/lib/resolve.c @@ -462,7 +462,7 @@ static int write_extra_records(const rr_array_t *arr, knot_pkt_t *answer) /** * \param all_secure optionally &&-combine security of written RRs into its value. - * (i.e. if you pass reference to false, it will always remain) + * (i.e. if you pass a pointer to false, it will always remain) * @return error code, ignoring if forced to truncate the packet. */ static int write_extra_ranked_records(const ranked_rr_array_t *arr, knot_pkt_t *answer, @@ -492,7 +492,7 @@ static int write_extra_ranked_records(const ranked_rr_array_t *arr, knot_pkt_t * } if (rr->type != KNOT_RRTYPE_RRSIG) { - all_sec = all_sec && (entry->rank & KR_RANK_SECURE); + all_sec = all_sec && kr_rank_test(entry->rank, KR_RANK_SECURE); } }