From: Vladimír Čunát Date: Thu, 1 Nov 2018 10:24:50 +0000 (+0100) Subject: lib/zonecut: verbose output tweaks X-Git-Tag: v3.1.0~1^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4643f284c9d7c966e5fe84fd116ec7248e7da655;p=thirdparty%2Fknot-resolver.git lib/zonecut: verbose output tweaks --- diff --git a/lib/zonecut.c b/lib/zonecut.c index 774c58dd7..d0abe9daa 100644 --- a/lib/zonecut.c +++ b/lib/zonecut.c @@ -333,6 +333,7 @@ static addrset_info_t fetch_addr(pack_t *addrs, const knot_dname_t *ns, uint16_t kr_memreserve, mm_pool); if (ret) abort(); /* ENOMEM "probably" */ + int usable_cnt = 0; addrset_info_t result = AI_EMPTY; knot_rdata_t *rd = cached_rr.rrs.rdata; for (uint16_t i = 0; i < cached_rr.rrs.count; ++i, rd = knot_rdataset_next(rd)) { @@ -350,6 +351,7 @@ static addrset_info_t fetch_addr(pack_t *addrs, const knot_dname_t *ns, uint16_t < rtt_e->tout_timestamp + ctx->cache_rtt_tout_retry_interval; if (!unusable) { result = AI_OK; + ++usable_cnt; } ret = pack_obj_push(addrs, rd->data, rd->len); @@ -363,6 +365,10 @@ static addrset_info_t fetch_addr(pack_t *addrs, const knot_dname_t *ns, uint16_t * Overall there's some overlap with nsrep.c functionality. */ } + if (usable_cnt != cached_rr.rrs.count) { + VERBOSE_MSG(qry, "usable NS addresses: %d/%d\n", + usable_cnt, cached_rr.rrs.count); + } return result; } @@ -423,7 +429,14 @@ static int fetch_ns(struct kr_context *ctx, struct kr_zonecut *cut, ? AI_REPUT : fetch_addr(*pack, ns_name, KNOT_RRTYPE_AAAA, cut->pool, qry); - /* FIXME: deep, perhaps separate into a function (break -> return). */ + #if 0 /* rather unlikely to be useful unless changing some zcut code */ + WITH_VERBOSE(qry) { + auto_free char *ns_name_txt = kr_dname_text(ns_name); + VERBOSE_MSG(qry, "NS %s infos: %d, %d\n", + ns_name_txt, (int)infos[0], (int)infos[1]); + } + #endif + /* AI_CYCLED checks. * If an ancestor query has its zone cut in the state that * it's looking for name or address(es) of some NS(s),