]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Revert GL !8447
authorMichał Kępień <michal@isc.org>
Wed, 1 Nov 2023 17:26:33 +0000 (18:26 +0100)
committerMichał Kępień <michal@isc.org>
Wed, 1 Nov 2023 17:26:33 +0000 (18:26 +0100)
This reverts commit bd572bb5af07e5e45781a90c047d910549514cf3
(c02925763ec61e92fb363b8754099793c3494168,
3aeac8e2a97ee831099f78e5363e503ecdd27917, and
57d8e2949d27e312d47b240e5c7bc3d1d5bf130c), reversing changes made to
28c92c9b26052a93b0867ffc04222a3a7817480e.

CHANGES
bin/tests/system/serve-stale/ns1/root.db
bin/tests/system/serve-stale/ns3/named.conf.in [deleted file]
bin/tests/system/serve-stale/ns3/serve.stale.db [deleted file]
bin/tests/system/serve-stale/ns6/named.conf.in [deleted file]
bin/tests/system/serve-stale/ns6/serve.stale.db [deleted file]
bin/tests/system/serve-stale/ns6/stale.db [deleted file]
bin/tests/system/serve-stale/setup.sh
bin/tests/system/serve-stale/tests.sh
doc/notes/notes-current.rst
lib/ns/query.c

diff --git a/CHANGES b/CHANGES
index cc9e714aaf1ec6970e7be0c129c8484d2747b2bb..cfad2211421153af152d9ba7520d6a48c76c7b18 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,3 @@
-6277.  [bug]           Take into account local authoritative zones when
-                       falling back to serve-stale. [GL #4355]
-
 6254.  [cleanup]       Add semantic patch to do an explicit cast from char
                        to unsigned char in ctype.h class of functions.
                        [GL #4327]
index e36f2b05621c172787a8c9431915076537827fc7..aef8e31c7aa753849a081cf0f9dcd20ee94f434d 100644 (file)
@@ -16,5 +16,3 @@ example.      300     NS      ns.example.
 ns.example.    300     A       10.53.0.2
 slow.          300     NS      ns.slow.
 ns.slow.       300     A       10.53.0.2
-stale.         300     NS      ns.stale.
-ns.stale.      300     A       10.53.0.6
diff --git a/bin/tests/system/serve-stale/ns3/named.conf.in b/bin/tests/system/serve-stale/ns3/named.conf.in
deleted file mode 100644 (file)
index d5f4751..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
- *
- * SPDX-License-Identifier: MPL-2.0
- *
- * 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 https://mozilla.org/MPL/2.0/.
- *
- * See the COPYRIGHT file distributed with this work for additional
- * information regarding copyright ownership.
- */
-
-key rndc_key {
-       secret "1234abcd8765";
-       algorithm @DEFAULT_HMAC@;
-};
-
-controls {
-       inet 10.53.0.3 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
-};
-
-options {
-       query-source address 10.53.0.3;
-       notify-source 10.53.0.3;
-       transfer-source 10.53.0.3;
-       port @PORT@;
-       pid-file "named.pid";
-       listen-on { 10.53.0.3; };
-       listen-on-v6 { none; };
-       recursion yes;
-       dnssec-validation no;
-       qname-minimization off;
-
-       stale-answer-enable yes;
-       stale-cache-enable yes;
-       stale-refresh-time 30;
-       stale-answer-client-timeout 1800;
-       max-cache-ttl 24h;
-};
-
-zone "." {
-       type hint;
-       file "root.db";
-};
-
-zone "serve.stale" IN {
-       type primary;
-       notify no;
-       file "serve.stale.db";
-};
diff --git a/bin/tests/system/serve-stale/ns3/serve.stale.db b/bin/tests/system/serve-stale/ns3/serve.stale.db
deleted file mode 100644 (file)
index 704f451..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-; Copyright (C) Internet Systems Consortium, Inc. ("ISC")
-;
-; SPDX-License-Identifier: MPL-2.0
-;
-; 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 https://mozilla.org/MPL/2.0/.
-;
-; See the COPYRIGHT file distributed with this work for additional
-; information regarding copyright ownership.
-
-serve.stale.           IN SOA  ns.serve.stale. matthijs.isc.org. 1 0 0 0 0
-serve.stale.           IN NS   ns.serve.stale.
-ns.serve.stale.                IN A    10.53.0.6
-
-$ORIGIN serve.stale.
-test                   IN NS   nss1.example.nxd.
-test                   IN NS   nss2.example.nxd.
diff --git a/bin/tests/system/serve-stale/ns6/named.conf.in b/bin/tests/system/serve-stale/ns6/named.conf.in
deleted file mode 100644 (file)
index 15f5dd6..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
- *
- * SPDX-License-Identifier: MPL-2.0
- *
- * 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 https://mozilla.org/MPL/2.0/.
- *
- * See the COPYRIGHT file distributed with this work for additional
- * information regarding copyright ownership.
- */
-
-key rndc_key {
-       secret "1234abcd8765";
-       algorithm @DEFAULT_HMAC@;
-};
-
-controls {
-       inet 10.53.0.6 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
-};
-
-options {
-       query-source address 10.53.0.6;
-       notify-source 10.53.0.6;
-       transfer-source 10.53.0.6;
-       port @PORT@;
-       pid-file "named.pid";
-       listen-on { 10.53.0.6; };
-       listen-on-v6 { none; };
-       recursion no;
-};
-
-zone "stale" IN {
-       type primary;
-       notify no;
-       file "stale.db";
-};
-
-zone "serve.stale" IN {
-       type primary;
-       notify no;
-       file "serve.stale.db";
-};
diff --git a/bin/tests/system/serve-stale/ns6/serve.stale.db b/bin/tests/system/serve-stale/ns6/serve.stale.db
deleted file mode 100644 (file)
index 2b17c68..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-; Copyright (C) Internet Systems Consortium, Inc. ("ISC")
-;
-; SPDX-License-Identifier: MPL-2.0
-;
-; 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 https://mozilla.org/MPL/2.0/.
-;
-; See the COPYRIGHT file distributed with this work for additional
-; information regarding copyright ownership.
-
-serve.stale.           IN SOA  ns.serve.stale. matthijs.isc.org. 1 0 0 0 0
-serve.stale.           IN NS   ns.serve.stale.
-ns.serve.stale.                IN A    10.53.0.6
-
-test                   IN TXT  "Oops, I did it again"
diff --git a/bin/tests/system/serve-stale/ns6/stale.db b/bin/tests/system/serve-stale/ns6/stale.db
deleted file mode 100644 (file)
index 4ae0068..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-; Copyright (C) Internet Systems Consortium, Inc. ("ISC")
-;
-; SPDX-License-Identifier: MPL-2.0
-;
-; 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 https://mozilla.org/MPL/2.0/.
-;
-; See the COPYRIGHT file distributed with this work for additional
-; information regarding copyright ownership.
-
-stale.         IN SOA  ns.stale. matthijs.isc.org. 1 0 0 0 0
-stale.         IN NS   ns.stale.
-ns.stale.      IN A    10.53.0.6
-
-serve.stale.   IN NS   ns.serve.stale.
-ns.serve.stale.        IN A    10.53.0.6
index 1ff0c807fbb178a9a545429c62f90ad20879bca9..7441e0cdd95bf4ac564a224ffda4fb750faeabbb 100644 (file)
@@ -17,7 +17,6 @@ SYSTEMTESTTOP=..
 $SHELL clean.sh
 
 copy_setports ns1/named1.conf.in ns1/named.conf
-copy_setports ns3/named.conf.in ns3/named.conf
+copy_setports ns3/named1.conf.in ns3/named.conf
 copy_setports ns4/named.conf.in ns4/named.conf
 copy_setports ns5/named.conf.in ns5/named.conf
-copy_setports ns6/named.conf.in ns6/named.conf
index 72b7e0cd0d2eb6e51558333fe1af04c717a7d6bd..a696132bb83f12a68770c015c398d85c97667647 100755 (executable)
@@ -254,29 +254,6 @@ grep "data\.example\..*4.*IN.*TXT.*A text record with a 2 second ttl" dig.out.te
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=$((status + ret))
 
-#
-# Test interaction with local zone
-#
-
-n=$((n + 1))
-echo_i "check that serve-stale does not recurse for local authoritative zone ($n)"
-ret=0
-
-num=0
-threshold=10
-while [ $num -lt $threshold ]; do
-
-  echo_i "dig test.serve.stale TXT ($n)"
-  $DIG -p ${PORT} @10.53.0.3 test.serve.stale TXT >dig.out.test$n.$num
-  grep "status: SERVFAIL" dig.out.test$n.$num >/dev/null || ret=1
-  if [ $ret != 0 ]; then num=$threshold; fi
-
-  sleep 1
-  num=$((num + 1))
-done
-if [ $ret != 0 ]; then echo_i "failed"; fi
-status=$((status + ret))
-
 #
 # Test disabling serve-stale via rndc.
 #
@@ -934,17 +911,6 @@ status=$((status + ret))
 #
 echo_i "test server with no serve-stale options set"
 
-n=$((n + 1))
-echo_i "updating ns3/named.conf ($n)"
-ret=0
-copy_setports ns3/named1.conf.in ns3/named.conf
-if [ $ret != 0 ]; then echo_i "failed"; fi
-status=$((status + ret))
-
-echo_i "restart ns3"
-stop_server --use-rndc --port ${CONTROLPORT} ns3
-start_server --noclean --restart --port ${PORT} ns3
-
 n=$((n + 1))
 echo_i "enable responses from authoritative server ($n)"
 ret=0
index 482a129e445b9298a52a49a987cfa0f52a1738a7..4fa8c9e474ae589a51502abf6755462f5f5e0330 100644 (file)
@@ -37,9 +37,6 @@ Bug Fixes
 
 - None.
 
-- Looking up stale data from the cache did not take into account local
-  authoritative zones. This has been fixed. :gl:`#4355`
-
 Known Issues
 ~~~~~~~~~~~~
 
index 9d09a2176ba89f8b2ce9797abc91f72dd48ebbd3..62b5ea846315418609c6285523b8ab3497fb7b24 100644 (file)
@@ -7319,19 +7319,8 @@ query_usestale(query_ctx_t *qctx, isc_result_t result) {
        qctx_freedata(qctx);
 
        if (dns_view_staleanswerenabled(qctx->client->view)) {
-               isc_result_t ret;
-               ret = query_getdb(qctx->client, qctx->client->query.qname,
-                                 qctx->client->query.qtype, qctx->options,
-                                 &qctx->zone, &qctx->db, &qctx->version,
-                                 &qctx->is_zone);
-               if (ret != ISC_R_SUCCESS) {
-                       /*
-                        * Failed to get the database, unexpected, but let us
-                        * at least abandon serve-stale.
-                        */
-                       return (false);
-               }
-
+               dns_db_attach(qctx->client->view->cachedb, &qctx->db);
+               qctx->version = NULL;
                qctx->client->query.dboptions |= DNS_DBFIND_STALEOK;
                if (qctx->client->query.fetch != NULL) {
                        dns_resolver_destroyfetch(&qctx->client->query.fetch);