]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Introduce zone functions dns_zone_(get|set)modded
authorMatthijs Mekking <matthijs@isc.org>
Tue, 24 Mar 2026 16:01:26 +0000 (17:01 +0100)
committerMatthijs Mekking <matthijs@isc.org>
Thu, 2 Apr 2026 12:35:54 +0000 (12:35 +0000)
Introduce new functions to set and get whether the zone configuration
has been modified with 'rndc modzone'.

lib/dns/include/dns/zone.h
lib/dns/zone.c

index 04719e4f8e261a130b77f6b1368cceb929364882..025282bea19b4cb76898f36b9ed5e34123222c80 100644 (file)
@@ -2243,6 +2243,26 @@ dns_zone_getadded(dns_zone_t *zone);
  * \li 'zone' to be valid.
  */
 
+void
+dns_zone_setmodded(dns_zone_t *zone, bool added);
+/*%
+ * Sets the value of zone->modded, which should be true for
+ * zones that were modified by "rndc modzone".
+ *
+ * Requires:
+ * \li 'zone' to be valid.
+ */
+
+bool
+dns_zone_getmodded(dns_zone_t *zone);
+/*%
+ * Returns true if the zone was modified at runtime
+ * using "rndc modzone".
+ *
+ * Requires:
+ * \li 'zone' to be valid.
+ */
+
 void
 dns_zone_setautomatic(dns_zone_t *zone, bool automatic);
 /*%
index ea3ccb1c16e9045dfd09fe4db4d2d4c84610f155..919613050aa97b27223c6d35fbbd5ae1bb11cbde 100644 (file)
@@ -422,6 +422,11 @@ struct dns_zone {
         */
        bool added;
 
+       /*%
+        * True if modded by "rndc modzone"
+        */
+       bool modded;
+
        /*%
         * True if added by automatically by named.
         */
@@ -22636,6 +22641,21 @@ dns_zone_getadded(dns_zone_t *zone) {
        return zone->added;
 }
 
+void
+dns_zone_setmodded(dns_zone_t *zone, bool modded) {
+       REQUIRE(DNS_ZONE_VALID(zone));
+
+       LOCK_ZONE(zone);
+       zone->modded = modded;
+       UNLOCK_ZONE(zone);
+}
+
+bool
+dns_zone_getmodded(dns_zone_t *zone) {
+       REQUIRE(DNS_ZONE_VALID(zone));
+       return zone->modded;
+}
+
 isc_result_t
 dns_zone_dlzpostload(dns_zone_t *zone, dns_db_t *db) {
        isc_time_t loadtime;