]> git.ipfire.org Git - thirdparty/knot-dns.git/commitdiff
load: distinguish if SOA serial is lower or incomparable in a warning log
authorDaniel Salzman <daniel.salzman@nic.cz>
Fri, 18 Mar 2022 08:18:54 +0000 (09:18 +0100)
committerDaniel Salzman <daniel.salzman@nic.cz>
Fri, 18 Mar 2022 11:16:29 +0000 (12:16 +0100)
src/knot/events/handlers/load.c
src/knot/zone/serial.h

index 8c83285905bb5afcaeaeb8bfebe5adaca8e4651f..8b15625057e588e9f042de3ba391ba343e3f9ee8 100644 (file)
@@ -240,7 +240,11 @@ load_end:
                        log_zone_warning(zone->name, "zone file changed without SOA serial update");
                        break;
                case KNOT_ERANGE:
-                       log_zone_warning(zone->name, "zone file changed, but SOA serial decreased");
+                       if (serial_compare(zone->zonefile.serial, zone_contents_serial(zone->contents)) == SERIAL_INCOMPARABLE) {
+                               log_zone_warning(zone->name, "zone file changed with incomparable SOA serial");
+                       } else {
+                               log_zone_warning(zone->name, "zone file changed with decreased SOA serial");
+                       }
                        break;
                }
                goto cleanup;
index 18e24b1284fc27585a202e9be9a0c7e7cabffdfc..effb1c63995b7c9c1936c3ff8cd12b8f35fe4432 100644 (file)
@@ -1,4 +1,4 @@
-/*  Copyright (C) 2019 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
+/*  Copyright (C) 2022 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
 
     This program is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -19,6 +19,8 @@
 #include <stdbool.h>
 #include <stdint.h>
 
+#define SERIAL_MAX_INCREMENT 2147483647
+
 /*!
  * \brief result of serial comparison. LOWER means that the first serial is lower that the second.
  *