From: Remi Gacogne Date: Thu, 28 May 2020 16:15:53 +0000 (+0200) Subject: rec: Fix RPZ removals when an update has several deltas X-Git-Tag: dnsdist-1.5.0-rc3~33^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b72e5c8578561a8c0a306a861011f5e409a4797b;p=thirdparty%2Fpdns.git rec: Fix RPZ removals when an update has several deltas --- diff --git a/pdns/rpzloader.cc b/pdns/rpzloader.cc index f397e0ce3c..80b4e00401 100644 --- a/pdns/rpzloader.cc +++ b/pdns/rpzloader.cc @@ -459,7 +459,8 @@ void RPZIXFRTracker(const std::vector& masters, boost::optionaldfe.getZone(zoneIdx); /* we need to make a _full copy_ of the zone we are going to work on */ std::shared_ptr newZone = std::make_shared(*oldZone); - std::shared_ptr newSR{nullptr}; + /* initialize the current serial to the last one */ + std::shared_ptr currentSR = sr; int totremove=0, totadd=0; bool fullUpdate = false; @@ -476,11 +477,17 @@ void RPZIXFRTracker(const std::vector& masters, boost::optional(rr); - if(oldsr && oldsr->d_st.serial == sr->d_st.serial) { + if (oldsr && oldsr->d_st.serial == currentSR->d_st.serial) { // cout<<"Got good removal of SOA serial "<d_st.serial<d_st.serial) + ", expecting " + std::to_string(currentSR->d_st.serial) + ") from SOA record while processing the removal part of an update"); + } + } } else { totremove++; @@ -494,9 +501,9 @@ void RPZIXFRTracker(const std::vector& masters, boost::optional(rr); - // g_log<d_st.serial<d_st.serial<& masters, boost::optionald_st.serial<setSerial(sr->d_st.serial);