]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
perform more testing on rndc <op> -redirect
authorMark Andrews <marka@isc.org>
Thu, 2 Feb 2017 06:25:54 +0000 (17:25 +1100)
committerMark Andrews <marka@isc.org>
Thu, 2 Feb 2017 06:25:54 +0000 (17:25 +1100)
16 files changed:
bin/named/server.c
bin/tests/system/addzone/clean.sh
bin/tests/system/addzone/ns1/named.conf
bin/tests/system/addzone/ns1/redirect.db.1 [moved from bin/tests/system/addzone/ns2/redirect.db with 100% similarity]
bin/tests/system/addzone/ns1/redirect.db.2 [new file with mode: 0644]
bin/tests/system/addzone/ns2/redirect.db.1 [new file with mode: 0644]
bin/tests/system/addzone/ns2/redirect.db.2 [new file with mode: 0644]
bin/tests/system/addzone/ns3/named.conf [new file with mode: 0644]
bin/tests/system/addzone/ns3/redirect.db.1 [new file with mode: 0644]
bin/tests/system/addzone/ns3/redirect.db.2 [new file with mode: 0644]
bin/tests/system/addzone/setup.sh
bin/tests/system/addzone/tests.sh
doc/arm/Bv9ARM-book.xml
lib/dns/include/dns/zone.h
lib/dns/win32/libdns.def.in
lib/dns/zone.c

index 82e3994f342efe3b614193be13ba9cf0bf8951ba..ef72ca319787e7e9256677e914e8f060d98e658e 100644 (file)
@@ -9042,7 +9042,8 @@ zone_from_args(ns_server_t *server, isc_lex_t *lex, const char *zonetxt,
        } else
                strlcpy(zonebuf, zonetxt, DNS_NAME_FORMATSIZE);
        if (zonename != NULL)
-               strlcpy(zonename, zonetxt, DNS_NAME_FORMATSIZE);
+               strlcpy(zonename, redirect ? "." : zonetxt,
+                       DNS_NAME_FORMATSIZE);
 
        dns_fixedname_init(&fname);
        name = dns_fixedname_name(&fname);
@@ -9161,7 +9162,9 @@ ns_server_retransfercommand(ns_server_t *server, isc_lex_t *lex,
                dns_zone_detach(&raw);
        }
        type = dns_zone_gettype(zone);
-       if (type == dns_zone_slave || type == dns_zone_stub)
+       if (type == dns_zone_slave || type == dns_zone_stub ||
+           (type == dns_zone_redirect &&
+            dns_zone_getredirecttype(zone) == dns_zone_slave))
                dns_zone_forcereload(zone);
        else
                result = ISC_R_NOTFOUND;
@@ -12318,7 +12321,7 @@ ns_server_delzone(ns_server_t *server, isc_lex_t *lex, isc_buffer_t **text) {
 static const cfg_obj_t *
 find_name_in_list_from_map(const cfg_obj_t *config,
                           const char *map_key_for_list,
-                          const char *name)
+                          const char *name, isc_boolean_t redirect)
 {
        const cfg_obj_t *list = NULL;
        const cfg_listelt_t *element;
@@ -12354,8 +12357,20 @@ find_name_in_list_from_map(const cfg_obj_t *config,
                if (name1 != NULL) {
                        result = dns_name_fromstring(name2, vname, 0, NULL);
                        if (result == ISC_R_SUCCESS &&
-                           dns_name_equal(name1, name2))
-                               break;
+                           dns_name_equal(name1, name2)) {
+                               const cfg_obj_t *zoptions;
+                               const cfg_obj_t *typeobj = NULL;
+                               zoptions = cfg_tuple_get(obj, "options");
+                               
+                               if (zoptions != NULL)
+                                       cfg_map_get(zoptions, "type", &typeobj);
+                               if (redirect && typeobj != NULL &&
+                                   strcasecmp(cfg_obj_asstring(typeobj),
+                                              "redirect") == 0)
+                                       break;
+                               else if (!redirect)
+                                       break;
+                       }
                } else if (strcasecmp(vname, name) == 0)
                        break;
 
@@ -12387,6 +12402,7 @@ ns_server_showzone(ns_server_t *server, isc_lex_t *lex, isc_buffer_t **text) {
 #ifdef HAVE_LMDB
        cfg_obj_t *nzconfig = NULL;
 #endif /* HAVE_LMDB */
+       isc_boolean_t added, redirect;
 
        /* Parse parameters */
        CHECK(zone_from_args(server, lex, NULL, &zone, zonename,
@@ -12396,6 +12412,8 @@ ns_server_showzone(ns_server_t *server, isc_lex_t *lex, isc_buffer_t **text) {
                goto cleanup;
        }
 
+       redirect = dns_zone_gettype(zone) == dns_zone_redirect;
+       added = dns_zone_getadded(zone);
        view = dns_zone_getview(zone);
        dns_zone_detach(&zone);
 
@@ -12409,16 +12427,20 @@ ns_server_showzone(ns_server_t *server, isc_lex_t *lex, isc_buffer_t **text) {
        RUNTIME_CHECK(result == ISC_R_SUCCESS);
        exclusive = ISC_TRUE;
 
-       /* Find the view statement */
-       vconfig = find_name_in_list_from_map(cfg->config, "view", view->name);
+       if (!added) {
+               /* Find the view statement */
+               vconfig = find_name_in_list_from_map(cfg->config, "view",
+                                                    view->name, ISC_FALSE);
 
-       /* Find the zone statement */
-       if (vconfig != NULL)
-               map = cfg_tuple_get(vconfig, "options");
-       else
-               map = cfg->config;
+               /* Find the zone statement */
+               if (vconfig != NULL)
+                       map = cfg_tuple_get(vconfig, "options");
+               else
+                       map = cfg->config;
 
-       zconfig = find_name_in_list_from_map(map, "zone", zonename);
+               zconfig = find_name_in_list_from_map(map, "zone", zonename,
+                                                    redirect);
+       }
 
 #ifndef HAVE_LMDB
        if (zconfig == NULL && cfg->nzf_config != NULL)
index 0eac23e6f1045da99305a355b71589f549aa019d..df059b0e98a45d3de8b7279cc68f63105b48ad9e 100644 (file)
 
 rm -f dig.out.*
 rm -f rndc.out*
+rm -f showzone.out*
+rm -f zonestatus.out*
 rm -f ns2/named.conf
 rm -f */named.memstats
+rm -f ns1/*.nzf
+rm -f ns1/*.nzf~
+rm -f ns1/*.nzd ns1/*.nzd-lock
 rm -f ns2/*.nzf
 rm -f ns2/*.nzf~
 rm -f ns2/*.nzd ns2/*.nzd-lock
@@ -22,3 +27,7 @@ rm -f ns2/inlineslave.bk*
 rm -f ns*/named.lock
 rm -f ns*/named.run
 rm -f ns2/nzf-*
+rm -f ns1/redirect.db
+rm -f ns2/redirect.db
+rm -f ns2/redirect.bk
+rm -f ns3/redirect.db
index ec8584bcce6b869fb9ff0ce63688e8fffbe65a15..b8ef619f4fea9cc0a6c4339872e8cafc8502023c 100644 (file)
@@ -6,9 +6,14 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-/* $Id: named1.conf,v 1.2 2010/08/11 18:14:19 each Exp $ */
+key rndc_key {
+        secret "1234abcd8765";
+        algorithm hmac-sha256;
+};
 
-controls { /* empty */ };
+controls {
+        inet 10.53.0.1 port 9953 allow { any; } keys { rndc_key; };
+};
 
 options {
        port 5300;
@@ -16,6 +21,7 @@ options {
        listen-on { 10.53.0.1; };
        listen-on-v6 { none; };
        allow-query { any; };
+       allow-new-zones yes;
        recursion no;
 };
 
@@ -28,3 +34,8 @@ zone "inlineslave.example" {
        type master;
        file "inlineslave.db";
 };
+
+zone "." {
+       type redirect;
+       file "redirect.db";
+};
diff --git a/bin/tests/system/addzone/ns1/redirect.db.2 b/bin/tests/system/addzone/ns1/redirect.db.2
new file mode 100644 (file)
index 0000000..2fa3e2f
--- /dev/null
@@ -0,0 +1,8 @@
+; Copyright (C) 2016  Internet Systems Consortium, Inc. ("ISC")
+;
+; This Source Code Form is subject to the terms of the Mozilla Public
+; License, v. 2.0. If a copy of the MPL was not distributed with this
+; file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+@      0       SOA     . . 1 0 0 0 0
+@      0       NS      .
diff --git a/bin/tests/system/addzone/ns2/redirect.db.1 b/bin/tests/system/addzone/ns2/redirect.db.1
new file mode 100644 (file)
index 0000000..4636dc8
--- /dev/null
@@ -0,0 +1,8 @@
+; Copyright (C) 2016  Internet Systems Consortium, Inc. ("ISC")
+;
+; This Source Code Form is subject to the terms of the Mozilla Public
+; License, v. 2.0. If a copy of the MPL was not distributed with this
+; file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+@      0       SOA     . . 0 0 0 0 0
+@      0       NS      .
diff --git a/bin/tests/system/addzone/ns2/redirect.db.2 b/bin/tests/system/addzone/ns2/redirect.db.2
new file mode 100644 (file)
index 0000000..2fa3e2f
--- /dev/null
@@ -0,0 +1,8 @@
+; Copyright (C) 2016  Internet Systems Consortium, Inc. ("ISC")
+;
+; This Source Code Form is subject to the terms of the Mozilla Public
+; License, v. 2.0. If a copy of the MPL was not distributed with this
+; file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+@      0       SOA     . . 1 0 0 0 0
+@      0       NS      .
diff --git a/bin/tests/system/addzone/ns3/named.conf b/bin/tests/system/addzone/ns3/named.conf
new file mode 100644 (file)
index 0000000..e143447
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2013, 2016  Internet Systems Consortium, Inc. ("ISC")
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+key rndc_key {
+        secret "1234abcd8765";
+        algorithm hmac-sha256;
+};
+
+controls {
+        inet 10.53.0.3 port 9953 allow { any; } keys { rndc_key; };
+};
+
+options {
+       port 5300;
+       pid-file "named.pid";
+       listen-on { 10.53.0.3; };
+       listen-on-v6 { none; };
+       recursion no;
+};
+
+zone "." {
+       type master;
+       file "redirect.db";
+};
diff --git a/bin/tests/system/addzone/ns3/redirect.db.1 b/bin/tests/system/addzone/ns3/redirect.db.1
new file mode 100644 (file)
index 0000000..167b533
--- /dev/null
@@ -0,0 +1,9 @@
+; Copyright (C) 2016  Internet Systems Consortium, Inc. ("ISC")
+;
+; This Source Code Form is subject to the terms of the Mozilla Public
+; License, v. 2.0. If a copy of the MPL was not distributed with this
+; file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+@      0       SOA     . . 0 0 0 0 0
+@      0       NS      .
+@      0       A       127.0.0.1
diff --git a/bin/tests/system/addzone/ns3/redirect.db.2 b/bin/tests/system/addzone/ns3/redirect.db.2
new file mode 100644 (file)
index 0000000..7bddb05
--- /dev/null
@@ -0,0 +1,9 @@
+; Copyright (C) 2016  Internet Systems Consortium, Inc. ("ISC")
+;
+; This Source Code Form is subject to the terms of the Mozilla Public
+; License, v. 2.0. If a copy of the MPL was not distributed with this
+; file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+@      0       SOA     . . 1 0 0 0 0
+@      0       NS      .
+@      0       A       127.0.0.1
index bfe085c76bcd0d890952d4b0cc316b2d1cf70c20..f793f104d221fba98bbae252524306a3d679ba2f 100644 (file)
@@ -11,5 +11,8 @@ SYSTEMTESTTOP=..
 
 $SHELL clean.sh
 
+cp -f ns1/redirect.db.1 ns1/redirect.db
+cp -f ns2/redirect.db.1 ns2/redirect.db
+cp -f ns3/redirect.db.1 ns3/redirect.db
 cp -f ns2/named1.conf ns2/named.conf
 cp -f ns2/default.nzf.in ns2/3bf305731dd26307.nzf
index d537e7fe67b51210bbb7c9ff6c04223eb2792687..6a8cc54c465333a1df284f155a4146476892a15c 100755 (executable)
@@ -177,6 +177,36 @@ n=`expr $n + 1`
 if [ $ret != 0 ]; then echo "I:failed"; fi
 status=`expr $status + $ret`
 
+echo "I:checking rndc showzone with a normally-loaded redirect zone ($n)"
+ret=0
+$RNDC -c ../common/rndc.conf -s 10.53.0.1 -p 9953 showzone -redirect > rndc.out.ns1.$n
+expected='zone "." { type redirect; file "redirect.db"; };'
+[ "`cat rndc.out.ns1.$n`" = "$expected" ] || ret=1
+n=`expr $n + 1`
+if [ $ret != 0 ]; then echo "I:failed"; fi
+status=`expr $status + $ret`
+
+echo "I:checking rndc zonestatus with a normally-loaded redirect zone ($n)"
+ret=0
+$RNDC -c ../common/rndc.conf -s 10.53.0.1 -p 9953 zonestatus -redirect > rndc.out.ns1.$n
+grep "type: redirect" rndc.out.ns1.$n > /dev/null || ret=1
+grep "serial: 0" rndc.out.ns1.$n > /dev/null || ret=1
+n=`expr $n + 1`
+if [ $ret != 0 ]; then echo "I:failed"; fi
+status=`expr $status + $ret`
+
+echo "I:checking rndc reload with a normally-loaded redirect zone ($n)"
+ret=0
+sleep 1
+cp -f ns1/redirect.db.2 ns1/redirect.db
+$RNDC -c ../common/rndc.conf -s 10.53.0.1 -p 9953 reload -redirect > rndc.out.ns1.$n
+$RNDC -c ../common/rndc.conf -s 10.53.0.1 -p 9953 zonestatus -redirect > zonestatus.out.ns1.$n
+grep "type: redirect" zonestatus.out.ns1.$n > /dev/null || ret=1
+grep "serial: 1" zonestatus.out.ns1.$n > /dev/null || ret=1
+n=`expr $n + 1`
+if [ $ret != 0 ]; then echo "I:failed"; fi
+status=`expr $status + $ret`
+
 echo "I:delete a normally-loaded zone ($n)"
 ret=0
 $RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 delzone normal.example > rndc.out.ns2.$n 2>&1
@@ -309,20 +339,63 @@ status=`expr $status + $ret`
 echo "I:check that adding a 'master redirect' zone works ($n)"
 ret=0
 $RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 addzone '"." { type redirect; file "redirect.db"; };' > rndc.out.ns2.$n 2>&1 || ret=1
+$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 showzone -redirect > showzone.out.ns2.$n 2>&1 || ret=1
+grep "type redirect;" showzone.out.ns2.$n > /dev/null || ret=1
+$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 zonestatus -redirect > zonestatus.out.ns2.$n 2>&1 || ret=1
+grep "type: redirect" zonestatus.out.ns2.$n > /dev/null || ret=1
+grep "serial: 0" zonestatus.out.ns2.$n > /dev/null || ret=1
+n=`expr $n + 1`
+if [ $ret != 0 ]; then echo "I:failed"; fi
+
+echo "I:check that reloading a added 'master redirect' zone works ($n)"
+ret=0
+sleep 1
+cp -f ns2/redirect.db.2 ns2/redirect.db
+$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload -redirect > rndc.out.ns2.$n
+$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 zonestatus -redirect > zonestatus.out.ns2.$n 2>&1 || ret=1
+grep "type: redirect" zonestatus.out.ns2.$n > /dev/null || ret=1
+grep "serial: 1" zonestatus.out.ns2.$n > /dev/null || ret=1
+n=`expr $n + 1`
+if [ $ret != 0 ]; then echo "I:failed"; fi
+
+echo "I:check that retransfer of a added 'master redirect' zone fails ($n)"
+ret=0
+$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 retransfer -redirect > rndc.out.ns2.$n 2>&1 && ret=1
 n=`expr $n + 1`
 if [ $ret != 0 ]; then echo "I:failed"; fi
-status=`expr $status + $ret`
 
 echo "I:check that deleting a 'master redirect' zone works ($n)"
 ret=0
 $RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 delzone -redirect > rndc.out.ns2.$n 2>&1 || ret=1
+$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 showzone -redirect > showzone.out.ns2.$n 2>&1 
+grep 'not found' showzone.out.ns2.$n > /dev/null || ret=1
 n=`expr $n + 1`
 if [ $ret != 0 ]; then echo "I:failed"; fi
 status=`expr $status + $ret`
 
 echo "I:check that adding a 'slave redirect' zone works ($n)"
 ret=0
-$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 addzone '"." { type redirect; masters { 1.2.3.4; }; file "redirect.bk"; };' > rndc.out.ns2.$n 2>&1 || ret=1
+$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 addzone '"." { type redirect; masters { 10.53.0.3;}; file "redirect.bk"; };' > rndc.out.ns2.$n 2>&1 || ret=1
+$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 showzone -redirect > showzone.out.ns2.$n 2>&1 || ret=1
+grep "type redirect;" showzone.out.ns2.$n > /dev/null || ret=1
+sleep 1
+$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 zonestatus -redirect > zonestatus.out.ns2.$n 2>&1 || ret=1
+grep "type: redirect" zonestatus.out.ns2.$n > /dev/null || ret=1
+grep "serial: 0" zonestatus.out.ns2.$n > /dev/null || ret=1
+n=`expr $n + 1`
+if [ $ret != 0 ]; then echo "I:failed"; fi
+status=`expr $status + $ret`
+
+echo "I:check that retransfering a added 'slave redirect' zone works ($n)"
+ret=0
+cp -f ns3/redirect.db.2 ns3/redirect.db
+$RNDC -c ../common/rndc.conf -s 10.53.0.3 -p 9953 reload . > showzone.out.ns3.$n 2>&1 || ret=1
+sleep 1
+$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 retransfer -redirect > rndc.out.ns2.$n 2>&1 || ret=1
+sleep 1
+$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 zonestatus -redirect > zonestatus.out.ns2.$n 2>&1 || ret=1
+grep "type: redirect" zonestatus.out.ns2.$n > /dev/null || ret=1
+grep "serial: 1" zonestatus.out.ns2.$n > /dev/null || ret=1
 n=`expr $n + 1`
 if [ $ret != 0 ]; then echo "I:failed"; fi
 status=`expr $status + $ret`
@@ -330,6 +403,8 @@ status=`expr $status + $ret`
 echo "I:check that deleting a 'slave redirect' zone works ($n)"
 ret=0
 $RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 delzone -redirect > rndc.out.ns2.$n 2>&1 || ret=1
+$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 showzone -redirect > showzone.out.ns2.$n 2>&1 
+grep 'not found' showzone.out.ns2.$n > /dev/null || ret=1
 n=`expr $n + 1`
 if [ $ret != 0 ]; then echo "I:failed"; fi
 status=`expr $status + $ret`
index 4d391f8c931b3a98dbec32fe4d6669809e75839b..f37b2cb9bdab02f2a7eebebda4dfaaf35966d102 100644 (file)
@@ -11972,7 +11972,11 @@ view "external" {
 
 <command>zone</command> <replaceable>"."</replaceable> [ <replaceable>class</replaceable> ] <command>{</command>
     <command>type</command> redirect;
-    <command>file</command> <replaceable>string</replaceable> ;
+  [ <command>file</command> <replaceable>string</replaceable> ; ]
+  [ <command>masters</command> [ <command>port</command> <replaceable>ip_port</replaceable> ] [ <command>dscp</command> <replaceable>ip_dscp</replaceable> ] <command>{</command>
+      ( <replaceable>masters_list</replaceable> | <replaceable>ip_addr</replaceable> [ <command>port</command> <replaceable>ip_port</replaceable> ] ) [ <command>key</command> <replaceable>key_name</replaceable> ] ;
+        ...
+    <command>}</command> ; ]
   [ <command>masterfile-format</command> ( <option>text</option> | <option>raw</option> | <option>map</option> ) ; ]
   [ <command>allow-query</command> <command>{</command> <replaceable>address_match_list</replaceable> <command>}</command> ; ]
   [ <command>max-zone-ttl</command> <replaceable>number</replaceable> ; ]
@@ -12275,18 +12279,25 @@ view "external" {
                        possible types; it is not limited to A and
                        AAAA records.
                      </para>
+                     <para>
+                       If a redirect zone is configured with a
+                       <option>masters</option> option, then it is
+                       transfered in as if it were a slave zone.
+                       Otherwise, it is loaded from a file as if it
+                       were a master zone.
+                     </para>
                      <para>
                        Because redirect zones are not referenced
                        directly by name, they are not kept in the
                        zone lookup table with normal master and slave
-                       zones. Consequently, it is not currently possible
-                       to use
-                       <command>rndc reload
-                               <replaceable>zonename</replaceable></command>
-                       to reload a redirect zone.  However, when using
-                       <command>rndc reload</command> without specifying
-                       a zone name, redirect zones will be reloaded along
-                       with other zones.
+                       zones. To reload a redirect zone, use
+                       <command>rndc reload -redirect</command>,
+                       and to retransfer a redirect zone configured
+                       as slave, use
+                       <command>rndc retransfer -redirect</command>.
+                       When using <command>rndc reload</command>
+                       without specifying a zone name, redirect zones
+                       will be reloaded along with other zones.
                      </para>
                    </entry>
                  </row>
index ab8d4f9a0af9b3dd7627e9616a2b5560ce5812b8..162108b0e42f2cb48aece2a39ca4d3e00898fd77 100644 (file)
@@ -1338,6 +1338,21 @@ dns_zone_gettype(dns_zone_t *zone);
  *\li  'zone' to be valid initialised zone.
  */
 
+dns_zonetype_t
+dns_zone_getredirecttype(dns_zone_t *zone);
+/*%<
+ * Returns whether the redirect zone is configured as a master or a
+ * slave zone.
+ *
+ * Requires:
+ *\li  'zone' to be valid initialised zone.
+ *\li  'zone' to be a redirect zone.
+ *
+ * Returns:
+ *\li  'dns_zone_master'
+ *\li  'dns_zone_slave'
+ */
+
 void
 dns_zone_settask(dns_zone_t *zone, isc_task_t *task);
 /*%<
index 96ea95fb63afbb3ba6365bd5c24c0efb5b2a8827..e948c9b1b92a94dcff5890bb5a41bb9dc2e0b8c2 100644 (file)
@@ -1210,6 +1210,7 @@ dns_zone_getqueryacl
 dns_zone_getqueryonacl
 dns_zone_getraw
 dns_zone_getrcvquerystats
+dns_zone_getredirecttype
 dns_zone_getrefreshkeytime
 dns_zone_getrefreshtime
 dns_zone_getrequestexpire
index 089235d533a809e791db8f85873547c5b78f6598..39f4a636aba0e846a4a6abe021a1627e4c76de57 100644 (file)
@@ -13415,6 +13415,14 @@ dns_zone_gettype(dns_zone_t *zone) {
        return (zone->type);
 }
 
+dns_zonetype_t
+dns_zone_getredirecttype(dns_zone_t *zone) {
+       REQUIRE(DNS_ZONE_VALID(zone));
+       REQUIRE(zone->type == dns_zone_redirect);
+
+       return (zone->masters == NULL ? dns_zone_master : dns_zone_slave);
+}
+
 dns_name_t *
 dns_zone_getorigin(dns_zone_t *zone) {
        REQUIRE(DNS_ZONE_VALID(zone));