]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
lib/resolve: do not do root priming in hotpath
authorMarek Vavruša <marek.vavrusa@nic.cz>
Tue, 3 Nov 2015 14:36:55 +0000 (15:36 +0100)
committerMarek Vavruša <marek.vavrusa@nic.cz>
Tue, 3 Nov 2015 14:36:55 +0000 (15:36 +0100)
refs #16

daemon/lua/trust_anchors.lua
lib/resolve.c

index d0d89ed1ea2c6402b63d65032ffcf986979234d8..aa5a9919c01f0c4cea5e859af9976ed31e04aa9b 100644 (file)
@@ -88,7 +88,7 @@ local function ta_missing(keyset, ta, hold_down_time)
 end
 
 -- Plan refresh event and re-schedule itself based on the result of the callback
-local function refresh_plan(trust_anchors, timeout, refresh_cb)
+local function refresh_plan(trust_anchors, timeout, refresh_cb, priming)
        trust_anchors.refresh_ev = event.after(timeout, function (ev)
                resolve('.', kres.type.DNSKEY, kres.class.IN, kres.query.NO_CACHE,
                function (pkt)
@@ -99,6 +99,10 @@ local function refresh_plan(trust_anchors, timeout, refresh_cb)
                        end
                        print('[trust_anchors] next refresh: '..next_time)
                        refresh_plan(trust_anchors, next_time, refresh_cb)
+                       -- Priming query, prime root NS next
+                       if priming ~= nil then
+                               resolve('.', kres.type.NS, kres.class.IN)
+                       end
                end)
        end)
 end
@@ -198,7 +202,7 @@ local trust_anchors = {
                trust_anchors.keyset = {}
                if trust_anchors.update(new_keys, true) then
                        if trust_anchors.refresh_ev ~= nil then event.cancel(trust_anchors.refresh_ev) end
-                       refresh_plan(trust_anchors, sec, active_refresh)
+                       refresh_plan(trust_anchors, sec, active_refresh, true)
                end
        end,
        -- Add DS/DNSKEY record(s) (unmanaged)
index 0a9aefcb11062fa58bfff3e761708428f7141dee..68c847981ecd98d3ec5dbc555f597c2aa72f3e41 100644 (file)
@@ -557,12 +557,7 @@ static int zone_cut_check(struct kr_request *request, struct kr_query *qry, knot
                                if (ret != 0) {
                                        return KNOT_STATE_FAIL;
                                }
-                               if (qry->sname[0] != '\0') {
-                                       DEBUG_MSG(qry, "=> root priming query\n");
-                                       zone_cut_subreq(rplan, qry, qry->zone_cut.name, KNOT_RRTYPE_NS);
-                               } else {
-                                       DEBUG_MSG(qry, "=> using root hints\n");
-                               }
+                               DEBUG_MSG(qry, "=> using root hints\n");
                                qry->flags &= ~QUERY_AWAIT_CUT;
                                return KNOT_STATE_DONE;
                        } else {