From b23f74ce057fe9810edbad88a159dbf03457c917 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marek=20Vavru=C5=A1a?= <marek.vavrusa@nic.cz>
Date: Wed, 18 Nov 2015 17:29:49 +0100
Subject: [PATCH] lib/zonecut: clear TA if its NS isn't cached

this fixes a bug when NS drops out of cache, but it's TA not,
so i.e. we end up with TA 'cz' and NS in '.', but we need the root TA
---
 lib/zonecut.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/zonecut.c b/lib/zonecut.c
index ed6350670..032a2e4bc 100644
--- a/lib/zonecut.c
+++ b/lib/zonecut.c
@@ -417,6 +417,8 @@ int kr_zonecut_find_cached(struct kr_context *ctx, struct kr_zonecut *cut, const
 			update_cut_name(cut, label);
 			mm_free(cut->pool, qname);
 			return kr_ok();
+		} else { /* Clear TA, as it is below any known NS. */
+			knot_rrset_free(&cut->trust_anchor, cut->pool);
 		}
 		/* Subtract label from QNAME. */
 		if (!is_root) {
-- 
GitLab