[Opendnssec-commits] [keihatsu.kirei.se/svn/dnssec] r4079 - trunk/OpenDNSSEC/signer/src/signer

Matthijs Mekking matthijs at nlnetlabs.nl
Tue Oct 12 10:42:29 CEST 2010


Author: matthijs
Date: 2010-10-12 10:42:29 +0200 (Tue, 12 Oct 2010)
New Revision: 4079

Modified:
   trunk/OpenDNSSEC/signer/src/signer/tools.c
   trunk/OpenDNSSEC/signer/src/signer/zonedata.c
Log:
update serial tweak



Modified: trunk/OpenDNSSEC/signer/src/signer/tools.c
===================================================================
--- trunk/OpenDNSSEC/signer/src/signer/tools.c	2010-10-11 14:28:51 UTC (rev 4078)
+++ trunk/OpenDNSSEC/signer/src/signer/tools.c	2010-10-12 08:42:29 UTC (rev 4079)
@@ -131,6 +131,9 @@
     se_log_verbose("update zone %s", zone->name?zone->name:"(null)");
     error = zone_update_zonedata(zone);
     if (!error) {
+        se_log_info("zone %s updated to serial %u",
+            zone->name?zone->name:"(null)", zone->zonedata->internal_serial);
+
         inbound = se_build_path(zone->name, ".inbound", 0);
         unsorted = se_build_path(zone->name, ".unsorted", 0);
         error = se_file_copy(inbound, unsorted);
@@ -189,6 +192,8 @@
     end = time(NULL);
     zone->stats->sig_time = (end-start);
     if (!error) {
+        se_log_info("zone %s signed, new serial %u",
+            zone->name?zone->name:"(null)", zone->zonedata->internal_serial);
         zone_backup_state(zone);
     }
     return error;

Modified: trunk/OpenDNSSEC/signer/src/signer/zonedata.c
===================================================================
--- trunk/OpenDNSSEC/signer/src/signer/zonedata.c	2010-10-11 14:28:51 UTC (rev 4078)
+++ trunk/OpenDNSSEC/signer/src/signer/zonedata.c	2010-10-12 08:42:29 UTC (rev 4079)
@@ -839,6 +839,9 @@
     se_log_assert(zd);
     se_log_assert(sc);
 
+    if (!zd->initialized) {
+        zd->internal_serial = zd->inbound_serial;
+    }
     prev = zd->internal_serial;
     if (se_strcmp(sc->soa_serial, "unixtime") == 0) {
         soa = se_max(zd->inbound_serial, (uint32_t) time_now());
@@ -866,12 +869,7 @@
         update = soa - prev;
     } else if (strncmp(sc->soa_serial, "keep", 4) == 0) {
         soa = zd->inbound_serial;
-        if (!zd->initialized) {
-            zd->internal_serial = soa;
-            zd->initialized = 1;
-            return 0;
-        }
-        if (!DNS_SERIAL_GT(soa, prev)) {
+        if (zd->initialized && !DNS_SERIAL_GT(soa, prev)) {
             se_log_error("cannot keep SOA SERIAL from input zone "
                 " (%u): output SOA SERIAL is %u", soa, prev);
             return 1;
@@ -885,9 +883,7 @@
     }
 
     if (!zd->initialized) {
-        zd->internal_serial = soa;
         zd->initialized = 1;
-        return 0;
     }
 
     /* serial is stored in 32 bits */




More information about the Opendnssec-commits mailing list