]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
971. [func] 'try-edns' can be use to disable edns on all queries.
authorMark Andrews <marka@isc.org>
Thu, 30 Aug 2001 05:52:18 +0000 (05:52 +0000)
committerMark Andrews <marka@isc.org>
Thu, 30 Aug 2001 05:52:18 +0000 (05:52 +0000)
CHANGES
bin/named/config.c
bin/named/query.c
bin/named/server.c
lib/dns/adb.c
lib/dns/include/dns/view.h
lib/dns/view.c
lib/isccfg/parser.c

diff --git a/CHANGES b/CHANGES
index 38407d00e9a665c8dc4e2298e51e7e0a91427d10..1b0f5a6282dadedb4d47ac2064e5408be6674ef4 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,5 @@
+ 971.  [func]          'try-edns' can be use to disable edns on all queries.
+
  970.  [func]          'journal-size' can now be used to set a target
                        size for a journal.
 
index 24bd1495a69eeaf4689a8daf5d6b5683ab852dda..fd4abd0f349ad11e592bca5a9cd78789a1da60ed 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: config.c,v 1.11 2001/08/07 01:58:54 marka Exp $ */
+/* $Id: config.c,v 1.12 2001/08/30 05:52:08 marka Exp $ */
 
 #include <config.h>
 
@@ -101,6 +101,7 @@ options {\n\
        recursion true;\n\
        provide-ixfr true;\n\
        request-ixfr true;\n\
+       try-edns true;\n\
        fetch-glue no;\n\
        rfc2308-type1 no;\n\
        additional-from-auth true;\n\
index 7f75489c8f2e1494f80913df35703f5873eeac51..c0d64326024dfe6c12a6b1d7b1170959eb26c15e 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: query.c,v 1.198 2001/08/27 17:20:09 gson Exp $ */
+/* $Id: query.c,v 1.199 2001/08/30 05:52:10 marka Exp $ */
 
 #include <config.h>
 
@@ -2080,6 +2080,7 @@ query_recurse(ns_client_t *client, dns_rdatatype_t qtype, dns_name_t *qdomain,
 {
        isc_result_t result;
        dns_rdataset_t *rdataset, *sigrdataset;
+       unsigned int options;
 
        /*
         * We are about to recurse, which means that this client will
@@ -2123,10 +2124,13 @@ query_recurse(ns_client_t *client, dns_rdatatype_t qtype, dns_name_t *qdomain,
 
        if (client->query.timerset == ISC_FALSE)
                ns_client_settimeout(client, 60);
+       options = client->query.fetchoptions;
+       if (!client->view->tryedns) 
+               options |= DNS_FETCHOPT_NOEDNS0;
        result = dns_resolver_createfetch(client->view->resolver,
                                          client->query.qname,
                                          qtype, qdomain, nameservers,
-                                         NULL, client->query.fetchoptions,
+                                         NULL, options,
                                          client->task,
                                          query_resume, client,
                                          rdataset, sigrdataset,
index ef342ad2f9acdb3cf3f3e35ed5af532daa44424a..5b86c640df673a49db0e3b439a20a582367bf0c1 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: server.c,v 1.339 2001/08/07 01:58:56 marka Exp $ */
+/* $Id: server.c,v 1.340 2001/08/30 05:52:12 marka Exp $ */
 
 #include <config.h>
 
@@ -813,6 +813,11 @@ configure_view(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
        CHECK(configure_view_acl(vconfig, config, "sortlist",
                                 actx, ns_g_mctx, &view->sortlist));
 
+       obj = NULL;
+       result = ns_config_get(maps, "try-edns", &obj);
+       INSIST(result == ISC_R_SUCCESS);
+       view->tryedns = cfg_obj_asboolean(obj);
+
        obj = NULL;
        result = ns_config_get(maps, "request-ixfr", &obj);
        INSIST(result == ISC_R_SUCCESS);
index 98c2b36f5332d4197407d06c498ae817f362438c..aee91ba3f8de27128ebee27faf7df7a2b354e3c4 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: adb.c,v 1.181 2001/08/08 22:54:36 gson Exp $ */
+/* $Id: adb.c,v 1.182 2001/08/30 05:52:14 marka Exp $ */
 
 /*
  * Implementation notes
@@ -1593,6 +1593,7 @@ a6missing(dns_a6context_t *a6ctx, dns_name_t *a6name) {
        dns_adb_t *adb;
        dns_adbfetch6_t *fetch;
        isc_result_t result;
+       unsigned int options = 0;
 
        name = a6ctx->arg;
        INSIST(DNS_ADBNAME_VALID(name));
@@ -1605,9 +1606,11 @@ a6missing(dns_a6context_t *a6ctx, dns_name_t *a6name) {
                return;
        }
 
+       if (!adb->view->tryedns)
+               options |= DNS_FETCHOPT_NOEDNS0;
        result = dns_resolver_createfetch(adb->view->resolver, a6name,
                                          dns_rdatatype_a6,
-                                         NULL, NULL, NULL, 0,
+                                         NULL, NULL, NULL, options,
                                          adb->task, fetch_callback_a6,
                                          name, &fetch->rdataset, NULL,
                                          &fetch->fetch);
@@ -3748,6 +3751,8 @@ fetch_name_v4(dns_adbname_t *adbname, isc_boolean_t start_at_root) {
                goto cleanup;
        }
 
+       if (!adb->view->tryedns)
+               options |= DNS_FETCHOPT_NOEDNS0;
        result = dns_resolver_createfetch(adb->view->resolver, &adbname->name,
                                          dns_rdatatype_a,
                                          name, nameservers, NULL, options,
@@ -3775,6 +3780,7 @@ fetch_name_aaaa(dns_adbname_t *adbname) {
        isc_result_t result;
        dns_adbfetch_t *fetch;
        dns_adb_t *adb;
+       unsigned int options = 0;
 
        INSIST(DNS_ADBNAME_VALID(adbname));
        adb = adbname->adb;
@@ -3790,9 +3796,11 @@ fetch_name_aaaa(dns_adbname_t *adbname) {
                goto cleanup;
        }
 
+       if (!adb->view->tryedns)
+               options |= DNS_FETCHOPT_NOEDNS0;
        result = dns_resolver_createfetch(adb->view->resolver, &adbname->name,
                                          dns_rdatatype_aaaa,
-                                         NULL, NULL, NULL, 0,
+                                         NULL, NULL, NULL, options,
                                          adb->task, fetch_callback,
                                          adbname, &fetch->rdataset, NULL,
                                          &fetch->fetch);
@@ -3851,6 +3859,8 @@ fetch_name_a6(dns_adbname_t *adbname, isc_boolean_t start_at_root) {
        }
        fetch->flags |= FETCH_FIRST_A6;
 
+       if (!adb->view->tryedns)
+               options |= DNS_FETCHOPT_NOEDNS0;
        result = dns_resolver_createfetch(adb->view->resolver, &adbname->name,
                                          dns_rdatatype_a6,
                                          name, nameservers, NULL, options,
index 4479260dbd0e1fa2a360d94f616d10e9634363c0..43d6a678cd868f4cb73bd443832d2a3b9653c719 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: view.h,v 1.73 2001/08/28 03:58:23 marka Exp $ */
+/* $Id: view.h,v 1.74 2001/08/30 05:52:16 marka Exp $ */
 
 #ifndef DNS_VIEW_H
 #define DNS_VIEW_H 1
@@ -113,6 +113,7 @@ struct dns_view {
        dns_acl_t *                     sortlist;
        isc_boolean_t                   requestixfr;
        isc_boolean_t                   provideixfr;
+       isc_boolean_t                   tryedns;
        dns_ttl_t                       maxcachettl;
        dns_ttl_t                       maxncachettl;
        in_port_t                       dstport;
index e6c4d0c9c09e3c3e1f43559f206f9fbf27e972ca..6639cbe5676019f5592f6751839fc6fe34db4b45 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: view.c,v 1.103 2001/08/27 17:20:10 gson Exp $ */
+/* $Id: view.c,v 1.104 2001/08/30 05:52:15 marka Exp $ */
 
 #include <config.h>
 
@@ -158,6 +158,7 @@ dns_view_create(isc_mem_t *mctx, dns_rdataclass_t rdclass,
        view->maxcachettl = 7 * 24 * 3600;
        view->maxncachettl = 3 * 3600;
        view->dstport = 53;
+       view->tryedns = ISC_TRUE;
 
        result = dns_peerlist_new(view->mctx, &view->peers);
        if (result != ISC_R_SUCCESS)
index 3f1fae7f45cfabbbd4d187a43bf26005732e1080..3952f08d4bcf64fa2dd1c00c2398d52a70abf4dd 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: parser.c,v 1.71 2001/08/30 05:23:00 marka Exp $ */
+/* $Id: parser.c,v 1.72 2001/08/30 05:52:18 marka Exp $ */
 
 #include <config.h>
 
@@ -867,6 +867,7 @@ view_clauses[] = {
        { "recursion", &cfg_type_boolean, 0 },
        { "provide-ixfr", &cfg_type_boolean, 0 },
        { "request-ixfr", &cfg_type_boolean, 0 },
+       { "try-edns", &cfg_type_boolean, 0 },
        { "fetch-glue", &cfg_type_boolean, CFG_CLAUSEFLAG_OBSOLETE },
        { "rfc2308-type1", &cfg_type_boolean, CFG_CLAUSEFLAG_NYI },
        { "additional-from-auth", &cfg_type_boolean, 0 },