]> granicus.if.org Git - pdns/commitdiff
implement suggestion of ticket 416, log SOA serial number after AXFR commit.
authorBert Hubert <bert.hubert@netherlabs.nl>
Mon, 13 Feb 2012 19:34:02 +0000 (19:34 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Mon, 13 Feb 2012 19:34:02 +0000 (19:34 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@2385 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/slavecommunicator.cc

index 33bb92874f0659a2f64cc23ee0de74938becfac1..dcd04115e9e4816a3aaf88eeea2835d38bb8ef42 100644 (file)
@@ -129,7 +129,7 @@ void CommunicatorClass::suck(const string &domain,const string &remote)
       }
     }
     AXFRRetriever retriever(raddr, domain.c_str(), tsigkeyname, tsigalgorithm, tsigsecret);
-    
+    unsigned int soa_serial = 0;
     while(retriever.getChunk(recs)) {
       if(first) {
         L<<Logger::Error<<"AXFR started for '"<<domain<<"', transaction started"<<endl;
@@ -141,6 +141,12 @@ void CommunicatorClass::suck(const string &domain,const string &remote)
         if(i->qtype.getCode() == QType::OPT || i->qtype.getCode() == QType::TSIG) // ignore EDNS0 & TSIG
           continue;
           
+        if(i->qtype.getCode() == QType::SOA) {
+          SOAData sd;
+          fillSOAData(i->content,sd);
+          soa_serial = sd.serial;
+        }
+          
         // we generate NSEC, NSEC3, NSEC3PARAM (sorry Olafur) on the fly, this could only confuse things
         if(dnssecZone && (i->qtype.getCode() == QType::NSEC || i->qtype.getCode() == QType::NSEC3 || 
                              i->qtype.getCode() == QType::NSEC3PARAM))
@@ -201,7 +207,7 @@ void CommunicatorClass::suck(const string &domain,const string &remote)
         
     di.backend->commitTransaction();
     di.backend->setFresh(domain_id);
-    L<<Logger::Error<<"AXFR done for '"<<domain<<"', zone committed"<<endl;
+    L<<Logger::Error<<"AXFR done for '"<<domain<<"', zone committed with serial number "<<soa_serial<<endl;
     if(::arg().mustDo("slave-renotify"))
       notifyDomain(domain);
   }