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)
{
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;
}
/**
* \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,
}
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);
}
}