]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
lib/zonecut: clear TA if its NS isn't cached
authorMarek Vavruša <marek.vavrusa@nic.cz>
Wed, 18 Nov 2015 16:29:49 +0000 (17:29 +0100)
committerMarek Vavruša <marek.vavrusa@nic.cz>
Wed, 18 Nov 2015 16:29:49 +0000 (17:29 +0100)
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

index ed6350670211550eafafab3794b9621dcc79071c..032a2e4bcf41e09ec8d1f04fedb63bf64a9ce4e2 100644 (file)
@@ -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) {