From: Matthijs Mekking Date: Tue, 24 Mar 2026 16:01:26 +0000 (+0100) Subject: Introduce zone functions dns_zone_(get|set)modded X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1bd1a40031402cea64b58a30e620a2603bc7cf8;p=thirdparty%2Fbind9.git Introduce zone functions dns_zone_(get|set)modded Introduce new functions to set and get whether the zone configuration has been modified with 'rndc modzone'. --- diff --git a/lib/dns/include/dns/zone.h b/lib/dns/include/dns/zone.h index 04719e4f8e2..025282bea19 100644 --- a/lib/dns/include/dns/zone.h +++ b/lib/dns/include/dns/zone.h @@ -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); /*% diff --git a/lib/dns/zone.c b/lib/dns/zone.c index ea3ccb1c16e..919613050aa 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -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;