request-ixfr to the zone level.
+3153. [func] Extend request-ixfr to zone level and remove the
+ side effect of forcing an AXFR.
+
3152. [cleanup] Some versions of gcc and clang failed due to
incorrect use of __builtin_expect. [RT #25183]
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: named.conf.docbook,v 1.52 2011/05/06 21:23:50 each Exp $ -->
+<!-- $Id: named.conf.docbook,v 1.53 2011/09/06 22:29:32 smann Exp $ -->
<refentry>
<refentryinfo>
<date>Aug 13, 2004</date>
max-refresh-time <replaceable>integer</replaceable>;
min-refresh-time <replaceable>integer</replaceable>;
multi-master <replaceable>boolean</replaceable>;
+ request-ixfr <replaceable>boolean</replaceable>;
sig-validity-interval <replaceable>integer</replaceable>;
transfer-source ( <replaceable>ipv4_address</replaceable> | * )
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: server.c,v 1.618 2011/09/02 21:15:30 each Exp $ */
+/* $Id: server.c,v 1.619 2011/09/06 22:29:32 smann Exp $ */
/*! \file */
"allow-update-forwarding", NULL, actx,
ns_g_mctx, &view->upfwdacl));
- obj = NULL;
- result = ns_config_get(maps, "request-ixfr", &obj);
- INSIST(result == ISC_R_SUCCESS);
- view->requestixfr = cfg_obj_asboolean(obj);
-
obj = NULL;
result = ns_config_get(maps, "provide-ixfr", &obj);
INSIST(result == ISC_R_SUCCESS);
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: zoneconf.c,v 1.181 2011/08/30 23:46:51 tbox Exp $ */
+/* $Id: zoneconf.c,v 1.182 2011/09/06 22:29:32 smann Exp $ */
/*% */
dns_zone_setoption(zone, DNS_ZONEOPT_IXFRFROMDIFFS,
ixfrdiff);
+ obj = NULL;
+ result = ns_config_get(maps, "request-ixfr", &obj);
+ INSIST(result == ISC_R_SUCCESS);
+ dns_zone_setrequestixfr(zone, cfg_obj_asboolean(obj));
+
checknames(ztype, maps, &obj);
INSIST(obj != NULL);
if (strcasecmp(cfg_obj_asstring(obj), "warn") == 0) {
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: clean.sh,v 1.6 2007/09/26 03:22:43 marka Exp $
+# $Id: clean.sh,v 1.7 2011/09/06 22:29:32 smann Exp $
rm -f ns1/named.conf ns1/myftp.db
+rm -f ns3/*.jnl ns3/mytest.db ns3/subtest.db
+rm -f ns4/*.jnl ns4/*.db
rm -f */named.memstats
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: setup.sh,v 1.4 2007/06/19 23:47:03 tbox Exp $
+# $Id: setup.sh,v 1.5 2011/09/06 22:29:32 smann Exp $
-rm -f ns1/*.db ns1/*.jnl
+rm -f ns1/*.db ns1/*.jnl ns3/*.jnl ns4/*.jnl
cat <<EOF >ns1/named.conf
options {
inet 10.53.0.1 port 9953 allow { any; } keys { rndc_key; };
};
EOF
+
+# Setup initial db files for ns3
+cp ns3/mytest0.db ns3/mytest.db
+cp ns3/subtest0.db ns3/subtest.db
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: tests.sh,v 1.7 2011/03/05 23:52:29 tbox Exp $
+# $Id: tests.sh,v 1.8 2011/09/06 22:29:32 smann Exp $
+
+
+# WARNING: The test labelled "testing request-ixfr option in view vs zone"
+# is fragile because it depends upon counting instances of records
+# in the log file - need a better approach <sdm> - until then,
+# if you add any tests above that point, you will break the test.
SYSTEMTESTTOP=..
. $SYSTEMTESTTOP/conf.sh
status=1
}
+echo "I:testing ixfr-from-differences option"
+# ns3 is master; ns4 is slave
+$CHECKZONE test. ns3/mytest.db > /dev/null 2>&1
+if [ $? -ne 0 ]
+then
+ echo "I:named-checkzone returned failure on ns3/mytest.db"
+fi
+# modify the master
+#echo "I: digging against master: "
+#$DIG $DIGOPTS @10.53.0.3 -p 5300 a host1.test.
+#echo "I: digging against slave: "
+#$DIG $DIGOPTS @10.53.0.4 -p 5300 a host1.test.
+
+cp ns3/mytest1.db ns3/mytest.db
+$RNDC -s 10.53.0.3 -p 9953 -c ../common/rndc.conf reload
+sleep 2
+
+# slave should have gotten notify and updated
+
+INCR=`grep "test/IN/primary" ns4/named.run|grep "got incremental"|wc -l`
+if [ $INCR -ne 1 ]
+then
+ echo "I:failed to get incremental response"
+ status=1
+fi
+
+echo "I:testing request-ixfr option in view vs zone"
+# There's a view with 2 zones. In the view, "request-ixfr yes"
+# but in the zone "sub.test", request-ixfr no"
+# we want to make sure that a change to sub.test results in AXFR, while
+# changes to test. result in IXFR
+
+echo "I: this result should be AXFR"
+cp ns3/subtest1.db ns3/subtest.db # change to sub.test zone, should be AXFR
+$RNDC -s 10.53.0.3 -p 9953 -c ../common/rndc.conf reload
+sleep 2
+
+echo "I: this result should be AXFR"
+NONINCR=`grep 'sub\.test/IN/primary' ns4/named.run|grep "got nonincremental" | wc -l`
+if [ $NONINCR -ne 2 ]
+then
+ echo "I:failed to get nonincremental response in 2nd AXFR test"
+ status=1
+else
+ echo "I: success: AXFR it was"
+fi
+
+echo "I: this result should be IXFR"
+cp ns3/mytest2.db ns3/mytest.db # change to test zone, should be IXFR
+$RNDC -s 10.53.0.3 -p 9953 -c ../common/rndc.conf reload
+sleep 2
+
+INCR=`grep "test/IN/primary" ns4/named.run|grep "got incremental"|wc -l`
+if [ $INCR -ne 2 ]
+then
+ echo "I:failed to get incremental response in 2nd IXFR test"
+ status=1
+else
+ echo "I: success: IXFR it was"
+fi
+
+
echo "I:exit status: $status"
exit $status
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- File: $Id: Bv9ARM-book.xml,v 1.501 2011/08/30 05:16:13 marka Exp $ -->
+<!-- File: $Id: Bv9ARM-book.xml,v 1.502 2011/09/06 22:29:32 smann Exp $ -->
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<title>BIND 9 Administrator Reference Manual</title>
the local server, acting as a slave, will request incremental zone
transfers from the given remote server, a master. If not set, the
value of the <command>request-ixfr</command> option in
- the view or
- global options block is used as a default.
+ the view or global options block is used as a default. It may
+ also be set in the zone block and, if set there, it will
+ override the global or view setting for that zone.
</para>
<para>
<optional> ixfr-base <replaceable>string</replaceable> ; </optional>
<optional> ixfr-from-differences <replaceable>yes_or_no</replaceable>; </optional>
<optional> ixfr-tmp-file <replaceable>string</replaceable> ; </optional>
+ <optional> request-ixfr <replaceable>yes_or_no</replaceable> ; </optional>
<optional> maintain-ixfr-base <replaceable>yes_or_no</replaceable> ; </optional>
<optional> max-ixfr-log-size <replaceable>number</replaceable> ; </optional>
<optional> max-transfer-idle-out <replaceable>number</replaceable> ; </optional>
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: view.h,v 1.135 2011/09/02 21:15:36 each Exp $ */
+/* $Id: view.h,v 1.136 2011/09/06 22:29:33 smann Exp $ */
#ifndef DNS_VIEW_H
#define DNS_VIEW_H 1
dns_rbt_t * answeracl_exclude;
dns_rbt_t * denyanswernames;
dns_rbt_t * answernames_exclude;
- isc_boolean_t requestixfr;
isc_boolean_t provideixfr;
isc_boolean_t requestnsid;
dns_ttl_t maxcachettl;
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: zone.h,v 1.193 2011/09/02 21:15:36 each Exp $ */
+/* $Id: zone.h,v 1.194 2011/09/06 22:29:33 smann Exp $ */
#ifndef DNS_ZONE_H
#define DNS_ZONE_H 1
* \li 'zone' to be valid.
*/
+isc_boolean_t
+dns_zone_getrequestixfr(dns_zone_t *zone);
+/*%
+ * Returns the true/false value of the request-ixfr option in the zone.
+ *
+ * Requires:
+ * \li 'zone' to be valid.
+ */
+
+void
+dns_zone_setrequestixfr(dns_zone_t *zone, isc_boolean_t flag);
+/*%
+ * Sets the request-ixfr option for the zone. Either true or false. The
+ * default value is determined by the setting of this option in the view.
+ *
+ * Requires:
+ * \li 'zone' to be valid.
+ */
+
void
dns_zone_setserialupdatemethod(dns_zone_t *zone, dns_updatemethod_t method);
/*%
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: view.c,v 1.183 2011/09/02 21:15:35 each Exp $ */
+/* $Id: view.c,v 1.184 2011/09/06 22:29:33 smann Exp $ */
/*! \file */
view->answeracl_exclude = NULL;
view->denyanswernames = NULL;
view->answernames_exclude = NULL;
- view->requestixfr = ISC_TRUE;
view->provideixfr = ISC_TRUE;
view->maxcachettl = 7 * 24 * 3600;
view->maxncachettl = 3 * 3600;
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: zone.c,v 1.631 2011/09/03 16:15:08 each Exp $ */
+/* $Id: zone.c,v 1.632 2011/09/06 22:29:33 smann Exp $ */
/*! \file */
*/
dns_updatemethod_t updatemethod;
+ /*%
+ * whether ixfr is requested
+ */
+ isc_boolean_t requestixfr;
+
/*%
* Outstanding forwarded UPDATE requests.
*/
*/
static void
got_transfer_quota(isc_task_t *task, isc_event_t *event) {
- isc_result_t result;
+ isc_result_t result = ISC_R_SUCCESS;
dns_peer_t *peer = NULL;
char master[ISC_SOCKADDR_FORMATSIZE];
char source[ISC_SOCKADDR_FORMATSIZE];
"no database exists yet, requesting AXFR of "
"initial version from %s", master);
xfrtype = dns_rdatatype_axfr;
-#if 0
- } else if (DNS_ZONE_OPTION(zone, DNS_ZONEOPT_IXFRFROMDIFFS)) {
- dns_zone_log(zone, ISC_LOG_DEBUG(1), "ixfr-from-differences "
- "set, requesting %sAXFR from %s", soa_before,
- master);
- if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_SOABEFOREAXFR))
- xfrtype = dns_rdatatype_soa;
- else
- xfrtype = dns_rdatatype_axfr;
-#endif
} else if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_FORCEXFER)) {
dns_zone_log(zone, ISC_LOG_DEBUG(1),
"forced reload, requesting AXFR of "
UNLOCK_ZONE(zone);
} else {
isc_boolean_t use_ixfr = ISC_TRUE;
- if (peer != NULL &&
- dns_peer_getrequestixfr(peer, &use_ixfr) ==
- ISC_R_SUCCESS) {
- ; /* Using peer setting */
- } else {
- use_ixfr = zone->view->requestixfr;
- }
+ if (peer != NULL)
+ result = dns_peer_getrequestixfr(peer, &use_ixfr);
+ if (peer == NULL || result != ISC_R_SUCCESS)
+ use_ixfr = zone->requestixfr;
if (use_ixfr == ISC_FALSE) {
dns_zone_log(zone, ISC_LOG_DEBUG(1),
"IXFR disabled, requesting %sAXFR from %s",
return (ISC_R_SUCCESS);
}
+void
+dns_zone_setrequestixfr(dns_zone_t *zone, isc_boolean_t bool) {
+ REQUIRE(DNS_ZONE_VALID(zone));
+ zone->requestixfr = bool;
+}
+
+isc_boolean_t
+dns_zone_getrequestixfr(dns_zone_t *zone) {
+ REQUIRE(DNS_ZONE_VALID(zone));
+ return (zone->requestixfr);
+}
+
void
dns_zone_setserialupdatemethod(dns_zone_t *zone, dns_updatemethod_t method) {
REQUIRE(DNS_ZONE_VALID(zone));
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: namedconf.c,v 1.140 2011/08/30 05:16:15 marka Exp $ */
+/* $Id: namedconf.c,v 1.141 2011/09/06 22:29:33 smann Exp $ */
/*! \file */
{ "notify-to-soa", &cfg_type_boolean, 0 },
{ "nsec3-test-zone", &cfg_type_boolean, CFG_CLAUSEFLAG_TESTONLY },
{ "serial-update-method", &cfg_type_updatemethod, 0 },
+ { "request-ixfr", &cfg_type_boolean, 0 },
{ "sig-signing-nodes", &cfg_type_uint32, 0 },
{ "sig-signing-signatures", &cfg_type_uint32, 0 },
{ "sig-signing-type", &cfg_type_uint32, 0 },