]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
misc nitpicks, not really changing anything
authorVladimír Čunát <vladimir.cunat@nic.cz>
Thu, 13 Apr 2017 14:09:39 +0000 (16:09 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 24 Apr 2017 17:37:45 +0000 (19:37 +0200)
lib/layer/iterate.c
lib/resolve.c

index 7e45e8a084bf195dfb83ae9f38f66032428f98cc..67ff7f177ad7a4404ff65ef804174d22bb083c7d 100644 (file)
@@ -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;
                }
index 21559213d0e16bdb7105fe03db77be40682551a6..68b66922bd1f05f9d205a69e663eec7ddf385a2a 100644 (file)
@@ -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);
                }
        }