]> git.ipfire.org Git - thirdparty/pdns.git/blobdiff - pdns/serialtweaker.cc
Merge pull request #7734 from franklouwers/docs2
[thirdparty/pdns.git] / pdns / serialtweaker.cc
index 06a036536bf073fe9f76e07b16d140e5e08b86ec..094e8a8a31c8197603fb0297bd0a73f96393f00e 100644 (file)
@@ -65,17 +65,22 @@ uint32_t calculateEditSOA(uint32_t old_serial, const string& kind, const DNSName
     uint32_t inception = getStartOfWeek();
     if (old_serial < inception)
       return inception;
-  } else if(!kind.empty()) {
-    L<<Logger::Warning<<"SOA-EDIT type '"<<kind<<"' for zone "<<zonename<<" is unknown."<<endl;
   }
+  else if(pdns_iequals(kind,"NONE")) {
+    // do nothing to serial. needed because a metadata of "" will use the default-soa-edit setting instead.
+  }
+  else if(!kind.empty()) {
+    g_log<<Logger::Warning<<"SOA-EDIT type '"<<kind<<"' for zone "<<zonename<<" is unknown."<<endl;
+  }
+  // Seen strictly, this is a broken config: we can only come here if
+  // both SOA-EDIT and default-soa-edit are set to "", but the latter
+  // should be set to "NONE" instead.
   return old_serial;
 }
 
 uint32_t calculateEditSOA(uint32_t old_serial, DNSSECKeeper& dk, const DNSName& zonename) {
   string kind;
   dk.getSoaEdit(zonename, kind);
-  if(kind.empty())
-    return old_serial;
   return calculateEditSOA(old_serial, kind, zonename);
 }
 
@@ -108,7 +113,7 @@ static uint32_t calculateIncreaseSOA(uint32_t old_serial, const string& increase
     }
     return new_serial;
   } else if(!increaseKind.empty()) {
-    L<<Logger::Warning<<"SOA-EDIT-API/DNSUPDATE type '"<<increaseKind<<"' for zone "<<zonename<<" is unknown."<<endl;
+    g_log<<Logger::Warning<<"SOA-EDIT-API/DNSUPDATE type '"<<increaseKind<<"' for zone "<<zonename<<" is unknown."<<endl;
   }
   return old_serial;
 }