Permalink
Showing with 5 additions and 4 deletions.
  1. +5 −4 pdns/serialtweaker.cc
@@ -62,10 +62,11 @@ uint32_t calculateEditSoa(SOAData sd, const string& kind) {
uint32_t inception_serial = localtime_format_YYYYMMDDSS(inception, 1);
uint32_t dont_increment_after = localtime_format_YYYYMMDDSS(inception + 2*86400, 99);
- if(sd.serial <= dont_increment_after)
- return (sd.serial + 2); /* "day00" and "day01" are reserved for inception increasing, so increment sd.serial by two */
- else if(sd.serial < inception_serial)
- return inception_serial;
+ if(sd.serial < inception_serial - 1) { /* less than <inceptionday>00 */
+ return inception_serial; /* return <inceptionday>01 (skipping <inceptionday>00 as possible value) */
+ } else if(sd.serial <= dont_increment_after) { /* >= <inceptionday>00 but <= <inceptionday+2>99 */
+ return (sd.serial + 2); /* "<inceptionday>00" and "<inceptionday>01" are reserved for inception increasing, so increment sd.serial by two */
+ }
}
else if(pdns_iequals(kind,"INCEPTION-WEEK")) {
time_t inception = getStartOfWeek();

0 comments on commit 83609e2

Please sign in to comment.