5a21e7e
--- bind-9.3.3rc2/doc/misc/options.edns	2005-05-13 04:43:27.000000000 +0200
5a21e7e
+++ bind-9.3.3rc2/doc/misc/options	2006-11-02 13:00:25.000000000 +0100
5a21e7e
@@ -83,6 +83,7 @@
5a21e7e
         edns-udp-size <integer>;
5a21e7e
         root-delegation-only [ exclude { <quoted_string>; ... } ];
5a21e7e
         disable-algorithms <string> { <string>; ... };
5a21e7e
+        edns-enable <boolean>;
5a21e7e
         dnssec-enable <boolean>;
5a21e7e
         dnssec-lookaside <string> trust-anchor <string>;
5a21e7e
         dnssec-must-be-secure <string> <boolean>;
5a21e7e
@@ -263,6 +264,7 @@
5a21e7e
         edns-udp-size <integer>;
5a21e7e
         root-delegation-only [ exclude { <quoted_string>; ... } ];
5a21e7e
         disable-algorithms <string> { <string>; ... };
5a21e7e
+        edns-enable <boolean>;
5a21e7e
         dnssec-enable <boolean>;
5a21e7e
         dnssec-lookaside <string> trust-anchor <string>;
5a21e7e
         dnssec-must-be-secure <string> <boolean>;
5a21e7e
--- bind-9.3.3rc2/lib/dns/view.c.edns	2004-03-10 03:55:58.000000000 +0100
5a21e7e
+++ bind-9.3.3rc2/lib/dns/view.c	2006-11-02 12:47:07.000000000 +0100
5a21e7e
@@ -156,6 +156,7 @@
5a21e7e
 	view->additionalfromcache = ISC_TRUE;
5a21e7e
 	view->additionalfromauth = ISC_TRUE;
5a21e7e
 	view->enablednssec = ISC_TRUE;
5a21e7e
+	view->enableedns = ISC_TRUE;
5a21e7e
 	view->minimalresponses = ISC_FALSE;
5a21e7e
 	view->transfer_format = dns_one_answer;
5a21e7e
 	view->queryacl = NULL;
5a21e7e
--- bind-9.3.3rc2/lib/dns/include/dns/view.h.edns	2004-03-10 03:55:58.000000000 +0100
5a21e7e
+++ bind-9.3.3rc2/lib/dns/include/dns/view.h	2006-11-02 12:47:07.000000000 +0100
5a21e7e
@@ -109,6 +109,7 @@
5a21e7e
 	isc_boolean_t			additionalfromauth;
5a21e7e
 	isc_boolean_t			minimalresponses;
5a21e7e
 	isc_boolean_t			enablednssec;
5a21e7e
+	isc_boolean_t			enableedns;
5a21e7e
 	dns_transfer_format_t		transfer_format;
5a21e7e
 	dns_acl_t *			queryacl;
5a21e7e
 	dns_acl_t *			recursionacl;
5a21e7e
--- bind-9.3.3rc2/lib/isccfg/namedconf.c.edns	2006-03-02 01:37:20.000000000 +0100
5a21e7e
+++ bind-9.3.3rc2/lib/isccfg/namedconf.c	2006-11-02 12:47:07.000000000 +0100
5a21e7e
@@ -726,6 +726,7 @@
5a21e7e
 	{ "root-delegation-only",  &cfg_type_optional_exclude, 0 },
5a21e7e
 	{ "disable-algorithms", &cfg_type_disablealgorithm,
5a21e7e
 	  CFG_CLAUSEFLAG_MULTI },
5a21e7e
+	{ "edns-enable", &cfg_type_boolean, 0 },
5a21e7e
 	{ "dnssec-enable", &cfg_type_boolean, 0 },
5a21e7e
 	{ "dnssec-lookaside", &cfg_type_lookaside, CFG_CLAUSEFLAG_MULTI },
5a21e7e
 	{ "dnssec-must-be-secure",  &cfg_type_mustbesecure,
5a21e7e
--- bind-9.3.3rc2/bin/named/server.c.edns	2006-11-02 12:47:07.000000000 +0100
5a21e7e
+++ bind-9.3.3rc2/bin/named/server.c	2006-11-02 12:47:07.000000000 +0100
5a21e7e
@@ -1181,6 +1181,11 @@
5a21e7e
 	result = ns_config_get(maps, "provide-ixfr", &obj);
5a21e7e
 	INSIST(result == ISC_R_SUCCESS);
5a21e7e
 	view->provideixfr = cfg_obj_asboolean(obj);
5a21e7e
+
5a21e7e
+        obj = NULL;
5a21e7e
+        (void)ns_config_get(maps, "edns-enable", &obj);
5a21e7e
+        if (obj != NULL)
5a21e7e
+		view->enableedns = cfg_obj_asboolean(obj);
5a21e7e
 			
5a21e7e
 	obj = NULL;
5a21e7e
 	result = ns_config_get(maps, "dnssec-enable", &obj);
5a21e7e
--- bind-9.3.3rc2/bin/named/query.c.edns	2006-08-31 05:57:11.000000000 +0200
5a21e7e
+++ bind-9.3.3rc2/bin/named/query.c	2006-11-02 12:47:07.000000000 +0100
5a21e7e
@@ -3558,6 +3558,12 @@
5a21e7e
 	if (client->view->enablednssec)
5a21e7e
 		message->flags |= DNS_MESSAGEFLAG_AD;
5a21e7e
 
5a21e7e
+        /*
5a21e7e
+         * Disable edns if an user require it.
5a21e7e
+         */
5a21e7e
+        if (!client->view->enableedns)
5a21e7e
+                client->query.fetchoptions |= DNS_FETCHOPT_NOEDNS0;
5a21e7e
+
5a21e7e
 	qclient = NULL;
5a21e7e
 	ns_client_attach(client, &qclient);
5a21e7e
 	query_find(qclient, NULL, qtype);
5a21e7e
--- bind-9.3.3rc2/bin/named/config.c.edns	2006-02-28 07:32:53.000000000 +0100
5a21e7e
+++ bind-9.3.3rc2/bin/named/config.c	2006-11-02 12:47:07.000000000 +0100
5a21e7e
@@ -125,6 +125,7 @@
5a21e7e
 	check-names master fail;\n\
5a21e7e
 	check-names slave warn;\n\
5a21e7e
 	check-names response ignore;\n\
5a21e7e
+	edns-enable yes;\n\
5a21e7e
 	dnssec-enable no; /* Make yes for 9.4. */ \n\
5a21e7e
 "
5a21e7e