From c8e3b24d07d32a280621c728cfb78075d78ee5cd Mon Sep 17 00:00:00 2001 From: Otto Date: Fri, 26 Mar 2021 16:30:01 +0100 Subject: [PATCH] Review comments: clean d_from if needed and a merge oversight. --- pdns/recursor_cache.cc | 2 ++ pdns/reczones.cc | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/pdns/recursor_cache.cc b/pdns/recursor_cache.cc index 8a798a60a1..94940c37b2 100644 --- a/pdns/recursor_cache.cc +++ b/pdns/recursor_cache.cc @@ -452,6 +452,8 @@ void MemRecursorCache::replace(time_t now, const DNSName &qname, const QType& qt ce.d_authZone = authZone; if (from) { ce.d_from = *from; + } else { + ce.d_from = ComboAddress(); } for (const auto& i : content) { diff --git a/pdns/reczones.cc b/pdns/reczones.cc index 992958b1d1..007543a2ca 100644 --- a/pdns/reczones.cc +++ b/pdns/reczones.cc @@ -69,13 +69,13 @@ bool primeHints(void) arr.d_content=std::make_shared(ComboAddress(rootIps4[c-'a'])); vector aset; aset.push_back(arr); - s_RC->replace(time(0), DNSName(templ), QType(QType::A), aset, vector>(), vector>(), true, g_rootdnsname, boost::none, boost::none, validationState); // auth, nuke it all + s_RC->replace(time(0), DNSName(templ), QType(QType::A), aset, vector>(), vector>(), true, g_rootdnsname, boost::none, boost::none, validationState, from); // auth, nuke it all if (rootIps6[c-'a'] != NULL) { aaaarr.d_content=std::make_shared(ComboAddress(rootIps6[c-'a'])); vector aaaaset; aaaaset.push_back(aaaarr); - s_RC->replace(time(0), DNSName(templ), QType(QType::AAAA), aaaaset, vector>(), vector>(), true, g_rootdnsname, boost::none, boost::none, validationState); + s_RC->replace(time(0), DNSName(templ), QType(QType::AAAA), aaaaset, vector>(), vector>(), true, g_rootdnsname, boost::none, boost::none, validationState, from); } nsset.push_back(nsrr); @@ -95,12 +95,12 @@ bool primeHints(void) seenA.insert(rr.qname); vector aset; aset.push_back(DNSRecord(rr)); - s_RC->replace(time(0), rr.qname, QType(QType::A), aset, vector>(), vector>(), true, g_rootdnsname, boost::none, boost::none, validationState); // auth, etc see above + s_RC->replace(time(0), rr.qname, QType(QType::A), aset, vector>(), vector>(), true, g_rootdnsname, boost::none, boost::none, validationState, from); // auth, etc see above } else if(rr.qtype.getCode()==QType::AAAA) { seenAAAA.insert(rr.qname); vector aaaaset; aaaaset.push_back(DNSRecord(rr)); - s_RC->replace(time(0), rr.qname, QType(QType::AAAA), aaaaset, vector>(), vector>(), true, g_rootdnsname, boost::none, boost::none, validationState); + s_RC->replace(time(0), rr.qname, QType(QType::AAAA), aaaaset, vector>(), vector>(), true, g_rootdnsname, boost::none, boost::none, validationState, from); } else if(rr.qtype.getCode()==QType::NS) { seenNS.insert(DNSName(rr.content)); rr.content=toLower(rr.content); @@ -136,7 +136,7 @@ bool primeHints(void) } s_RC->doWipeCache(g_rootdnsname, false, QType::NS); - s_RC->replace(time(0), g_rootdnsname, QType(QType::NS), nsset, vector>(), vector>(), false, g_rootdnsname, boost::none, boost::none, validationState); // and stuff in the cache + s_RC->replace(time(0), g_rootdnsname, QType(QType::NS), nsset, vector>(), vector>(), false, g_rootdnsname, boost::none, boost::none, validationState, from); // and stuff in the cache return true; } -- 2.47.2