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: rec-4.3.2~5^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6f286a2c6e173f31635c8d42e09c4db01c5f2cb7;p=thirdparty%2Fpdns.git rec: Fix RPZ removals when an update has several deltas (cherry picked from commit b72e5c8578561a8c0a306a861011f5e409a4797b) --- diff --git a/pdns/rpzloader.cc b/pdns/rpzloader.cc index d9f219c1ee..14d8af1bbd 100644 --- a/pdns/rpzloader.cc +++ b/pdns/rpzloader.cc @@ -458,7 +458,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; @@ -475,11 +476,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++; @@ -493,9 +500,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);