]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add new "mirror" slave zone option
authorMichał Kępień <michal@isc.org>
Thu, 28 Jun 2018 11:38:39 +0000 (13:38 +0200)
committerMichał Kępień <michal@isc.org>
Thu, 28 Jun 2018 11:38:39 +0000 (13:38 +0200)
Add a new slave-only boolean configuration option, "mirror", along with
its corresponding dns_zoneopt_t enum and a helper function for checking
whether that option was set for a given zone.  This commit does not
introduce any behavior changes yet.

bin/named/zoneconf.c
lib/dns/include/dns/zone.h
lib/dns/zone.c
lib/isccfg/namedconf.c

index 81040e5e245ac869a388dd10eee3cff57286ddb7..8c94472367ae862173e8991c060938605b726e41 100644 (file)
@@ -1724,6 +1724,13 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
                }
                dns_zone_setoption(mayberaw, DNS_ZONEOPT_MULTIMASTER, multi);
 
+               obj = NULL;
+               (void)cfg_map_get(zoptions, "mirror", &obj);
+               if (obj != NULL) {
+                       dns_zone_setoption(mayberaw, DNS_ZONEOPT_MIRROR,
+                                          cfg_obj_asboolean(obj));
+               }
+
                obj = NULL;
                result = named_config_get(maps, "max-transfer-time-in", &obj);
                INSIST(result == ISC_R_SUCCESS && obj != NULL);
index 4a7a9f9430b224a006f7ae6dc343f949d16fe9ad..553776f57097cf345a372128d5023ae578197bc6 100644 (file)
@@ -79,8 +79,10 @@ typedef enum {
        DNS_ZONEOPT_CHECKDUPRRFAIL   = 1<<26, /*%< fatal check-dup-records failures */
        DNS_ZONEOPT_CHECKSPF         = 1<<27, /*%< check SPF records */
        DNS_ZONEOPT_CHECKTTL         = 1<<28, /*%< check max-zone-ttl */
-       DNS_ZONEOPT_AUTOEMPTY        = 1<<29  /*%< automatic empty zone */
+       DNS_ZONEOPT_AUTOEMPTY        = 1<<29, /*%< automatic empty zone */
+       DNS_ZONEOPT_MIRROR           = 1<<30, /*%< mirror zone */
 } dns_zoneopt_t;
+
 /*
  * Zone key maintenance options
  */
@@ -2478,4 +2480,10 @@ dns_zone_getgluecachestats(dns_zone_t *zone);
  *     otherwise NULL.
  */
 
+isc_boolean_t
+dns_zone_ismirror(const dns_zone_t *zone);
+/*%<
+ * Return ISC_TRUE if 'zone' is a mirror zone, return ISC_FALSE otherwise.
+ */
+
 #endif /* DNS_ZONE_H */
index 769664d07b371971ce231a3952b8b0fa6458a02e..d0460a9b565a445a2288d6b17e001c2775164170 100644 (file)
@@ -19323,3 +19323,10 @@ dns_zone_getgluecachestats(dns_zone_t *zone) {
 
        return (zone->gluecachestats);
 }
+
+isc_boolean_t
+dns_zone_ismirror(const dns_zone_t *zone) {
+       REQUIRE(DNS_ZONE_VALID(zone));
+
+       return (DNS_ZONE_OPTION(zone, DNS_ZONEOPT_MIRROR));
+}
index 4526c660a7ce2acf513710369cda1d5870821a07..397ceafc11d3294af77ce41c62c7783dc64aca7b 100644 (file)
@@ -2147,6 +2147,9 @@ zone_clauses[] = {
        { "min-retry-time", &cfg_type_uint32,
                CFG_ZONE_SLAVE | CFG_ZONE_STUB
        },
+       { "mirror", &cfg_type_boolean,
+               CFG_ZONE_SLAVE
+       },
        { "multi-master", &cfg_type_boolean,
                CFG_ZONE_SLAVE | CFG_ZONE_STUB
        },