From: Marek VavruĊĦa Date: Thu, 1 Oct 2015 08:38:46 +0000 (+0200) Subject: lib/zonecut: fetch root DNSKEY from cache correctly X-Git-Tag: v1.0.0-beta1~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7ced728253f6ddec601dfcd95faf00c0decb3ca7;p=thirdparty%2Fknot-resolver.git lib/zonecut: fetch root DNSKEY from cache correctly previously it was always overwritten with SBELT for root + root TA doesn't have to be in cache (it's in trust store) --- diff --git a/lib/zonecut.c b/lib/zonecut.c index b149459b8..1bd0e1a59 100644 --- a/lib/zonecut.c +++ b/lib/zonecut.c @@ -396,11 +396,11 @@ int kr_zonecut_find_cached(struct kr_context *ctx, struct kr_zonecut *cut, const /* Start at QNAME parent. */ while (txn && name) { - bool has_ta = !secured || fetch_ta(cut, name, txn, timestamp) == 0; - if (secured) { - fetch_dnskey(cut, name, txn, timestamp); - } + bool has_ta = !secured || !name[0] || fetch_ta(cut, name, txn, timestamp) == 0; if (has_ta && fetch_ns(ctx, cut, name, txn, timestamp) == 0) { + if (secured) { + fetch_dnskey(cut, name, txn, timestamp); + } update_cut_name(cut, name); return kr_ok(); }