Commit c1350c27 authored by Vladimír Čunát's avatar Vladimír Čunát

nitpicks around zone cut searching

It's mostly just --verbose logging adjustments.
parent f0da0a35
......@@ -801,7 +801,8 @@ static int stash_rrset(const ranked_rr_array_t *arr, int arr_i,
WITH_VERBOSE(qry) {
/* Reduce verbosity. */
if (!kr_rank_test(entry->rank, KR_RANK_AUTH)) {
if (!kr_rank_test(entry->rank, KR_RANK_AUTH)
&& rr->type != KNOT_RRTYPE_NS) {
++*unauth_cnt;
return kr_ok();
}
......
......@@ -764,7 +764,8 @@ static int check_signer(kr_layer_t *ctx, knot_pkt_t *pkt)
return KR_STATE_DONE;
}
/** Change ranks of RRs from this single iteration: _INITIAL or _MISSING -> rank_to_set. */
/** Change ranks of RRs from this single iteration:
* _INITIAL or _TRY or _MISSING -> rank_to_set. */
static void rank_records(kr_layer_t *ctx, enum kr_rank rank_to_set)
{
struct kr_request *req = ctx->req;
......
......@@ -267,8 +267,7 @@ static int ns_fetch_cut(struct kr_query *qry, const knot_dname_t *requested_name
qry->flags.DNSSEC_WANT = false;
}
/* Check if any DNSKEY found for cached cut */
if ((qry->flags.DNSSEC_WANT) &&
(cut_found.key == NULL)) {
if ((qry->flags.DNSSEC_WANT) && (cut_found.key == NULL)) {
/* No DNSKEY was found for cached cut.
* If no glue were fetched for this cut,
* we have got circular dependency - must fetch A\AAAA
......@@ -1277,7 +1276,7 @@ static int zone_cut_check(struct kr_request *request, struct kr_query *qry, knot
if (ret != 0) {
return KR_STATE_FAIL;
}
VERBOSE_MSG(qry, "=> using root hints\n");
VERBOSE_MSG(qry, "=> no cache open, using root hints\n");
qry->flags.AWAIT_CUT = false;
return KR_STATE_DONE;
}
......
......@@ -354,7 +354,8 @@ static int fetch_secure_rrset(knot_rrset_t **rr, struct kr_cache *cache,
const struct kr_query *qry)
{
if (!rr) {
return kr_error(ENOENT);
assert(!EINVAL);
return kr_error(EINVAL);
}
/* peek, check rank and TTL */
struct kr_cache_p peek;
......@@ -416,18 +417,21 @@ int kr_zonecut_find_cached(struct kr_context *ctx, struct kr_zonecut *cut,
*secured = false;
}
/* Fetch DS and DNSKEY if caller wants secure zone cut */
int ret_ds = 1, ret_dnskey = 1;
if (*secured || is_root) {
fetch_secure_rrset(&cut->trust_anchor, &ctx->cache, label,
KNOT_RRTYPE_DS, cut->pool, qry);
fetch_secure_rrset(&cut->key, &ctx->cache, label,
KNOT_RRTYPE_DNSKEY, cut->pool, qry);
ret_ds = fetch_secure_rrset(&cut->trust_anchor, &ctx->cache,
label, KNOT_RRTYPE_DS, cut->pool, qry);
ret_dnskey = fetch_secure_rrset(&cut->key, &ctx->cache,
label, KNOT_RRTYPE_DNSKEY, cut->pool, qry);
}
update_cut_name(cut, label);
mm_free(cut->pool, qname);
kr_cache_sync(&ctx->cache);
WITH_VERBOSE(qry) {
auto_free char *label_str = kr_dname_text(label);
VERBOSE_MSG(qry, "found cut: %s\n", label_str);
VERBOSE_MSG(qry,
"found cut: %s (return codes: DS %d, DNSKEY %d)\n",
label_str, ret_ds, ret_dnskey);
}
return kr_ok();
}
......
Markdown is supported
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