From 046b69a59455054542cdc4f836f4227f14c54f5d Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Fri, 12 Jan 2024 09:50:00 +0100 Subject: [PATCH] Add test, only clear cache if the notify wasn't for an RPZ --- pdns/recursordist/pdns_recursor.cc | 6 ++-- pdns/recursordist/rpzloader.cc | 3 +- regression-tests.recursor-dnssec/test_RPZ.py | 30 +++++++++++++++++--- 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/pdns/recursordist/pdns_recursor.cc b/pdns/recursordist/pdns_recursor.cc index ad6c83c70c..e31cd7d31b 100644 --- a/pdns/recursordist/pdns_recursor.cc +++ b/pdns/recursordist/pdns_recursor.cc @@ -2318,8 +2318,10 @@ static string* doProcessUDPQuestion(const std::string& question, const ComboAddr SLOG(g_log << Logger::Notice << RecThreadInfo::id() << " got NOTIFY for " << qname.toLogString() << " from " << source.toStringWithPort() << (source != fromaddr ? " (via " + fromaddr.toStringWithPort() + ")" : "") << endl, g_slogudpin->info(Logr::Notice, "Got NOTIFY", "source", Logging::Loggable(source), "remote", Logging::Loggable(fromaddr), "qname", Logging::Loggable(qname))); } - notifyRPZTracker(qname); - requestWipeCaches(qname); + if (!notifyRPZTracker(qname)) { + // It wasn't an RPZ + requestWipeCaches(qname); + } // the operation will now be treated as a Query, generating // a normal response, as the rest of the code does not diff --git a/pdns/recursordist/rpzloader.cc b/pdns/recursordist/rpzloader.cc index 5f835969c6..c5e1036a9e 100644 --- a/pdns/recursordist/rpzloader.cc +++ b/pdns/recursordist/rpzloader.cc @@ -564,7 +564,7 @@ static bool RPZTrackerIteration(RPZTrackerParams& params, const DNSName& zoneNam if (resourceRecord.d_type == QType::SOA) { auto oldsr = getRR(resourceRecord); if (oldsr && oldsr->d_st.serial == currentSR->d_st.serial) { - // cout<<"Got good removal of SOA serial "<d_st.serial<(resourceRecord); - // g_log<d_st.serial<