Adam Tkac 5ea70d
--- bind-9.4.0/lib/dns/view.c.edns	2006-03-10 00:38:21.000000000 +0100
Adam Tkac 5ea70d
+++ bind-9.4.0/lib/dns/view.c	2007-03-06 14:55:44.000000000 +0100
Adam Tkac 5ea70d
@@ -160,6 +160,7 @@
Martin Stransky 25c020
 	view->additionalfromcache = ISC_TRUE;
Martin Stransky 25c020
 	view->additionalfromauth = ISC_TRUE;
Martin Stransky 25c020
 	view->enablednssec = ISC_TRUE;
Martin Stransky 25c020
+	view->enableedns = ISC_TRUE;
Adam Tkac 5ea70d
 	view->enablevalidation = ISC_TRUE;
Adam Tkac 5ea70d
 	view->acceptexpired = ISC_FALSE;
Martin Stransky 25c020
 	view->minimalresponses = ISC_FALSE;
Adam Tkac 5ea70d
--- bind-9.4.0/lib/dns/include/dns/view.h.edns	2006-03-10 00:38:21.000000000 +0100
Adam Tkac 5ea70d
+++ bind-9.4.0/lib/dns/include/dns/view.h	2007-03-06 14:56:19.000000000 +0100
Adam Tkac 5ea70d
@@ -112,6 +112,7 @@
Martin Stransky 25c020
 	isc_boolean_t			additionalfromauth;
Martin Stransky 25c020
 	isc_boolean_t			minimalresponses;
Martin Stransky 25c020
 	isc_boolean_t			enablednssec;
Martin Stransky 25c020
+	isc_boolean_t			enableedns;
Adam Tkac 5ea70d
 	isc_boolean_t			enablevalidation;
Adam Tkac 5ea70d
 	isc_boolean_t			acceptexpired;
Martin Stransky 25c020
 	dns_transfer_format_t		transfer_format;
Adam Tkac 5ea70d
--- bind-9.4.0/lib/isccfg/namedconf.c.edns	2006-05-03 03:46:40.000000000 +0200
Adam Tkac 5ea70d
+++ bind-9.4.0/lib/isccfg/namedconf.c	2007-03-06 14:43:48.000000000 +0100
Adam Tkac 5ea70d
@@ -767,6 +767,7 @@
Martin Stransky 25c020
 	{ "root-delegation-only",  &cfg_type_optional_exclude, 0 },
Martin Stransky 25c020
 	{ "disable-algorithms", &cfg_type_disablealgorithm,
Martin Stransky 25c020
 	  CFG_CLAUSEFLAG_MULTI },
Martin Stransky 25c020
+	{ "edns-enable", &cfg_type_boolean, 0 },
Martin Stransky 25c020
 	{ "dnssec-enable", &cfg_type_boolean, 0 },
Adam Tkac 5ea70d
 	{ "dnssec-validation", &cfg_type_boolean, 0 },
Martin Stransky 25c020
 	{ "dnssec-lookaside", &cfg_type_lookaside, CFG_CLAUSEFLAG_MULTI },
Adam Tkac 5ea70d
--- bind-9.4.0/doc/misc/options.edns	2006-05-03 04:26:59.000000000 +0200
Adam Tkac 5ea70d
+++ bind-9.4.0/doc/misc/options	2007-03-06 14:43:48.000000000 +0100
Adam Tkac 5ea70d
@@ -85,6 +85,7 @@
Adam Tkac 5ea70d
         max-udp-size <integer>;
Adam Tkac 5ea70d
         root-delegation-only [ exclude { <quoted_string>; ... } ];
Adam Tkac 5ea70d
         disable-algorithms <string> { <string>; ... };
Adam Tkac 5ea70d
+        edns-enable <boolean>;
Adam Tkac 5ea70d
         dnssec-enable <boolean>;
Adam Tkac 5ea70d
         dnssec-validation <boolean>;
Adam Tkac 5ea70d
         dnssec-lookaside <string> trust-anchor <string>;
Adam Tkac 5ea70d
@@ -313,6 +314,7 @@
Adam Tkac 5ea70d
         max-udp-size <integer>;
Adam Tkac 5ea70d
         root-delegation-only [ exclude { <quoted_string>; ... } ];
Adam Tkac 5ea70d
         disable-algorithms <string> { <string>; ... };
Adam Tkac 5ea70d
+        edns-enable <boolean>;
Adam Tkac 5ea70d
         dnssec-enable <boolean>;
Adam Tkac 5ea70d
         dnssec-validation <boolean>;
Adam Tkac 5ea70d
         dnssec-lookaside <string> trust-anchor <string>;
Adam Tkac 5ea70d
--- bind-9.4.0/bin/named/config.c.edns	2006-05-03 03:46:40.000000000 +0200
Adam Tkac 5ea70d
+++ bind-9.4.0/bin/named/config.c	2007-03-06 15:02:07.000000000 +0100
Adam Tkac 5ea70d
@@ -135,6 +135,7 @@
Adam Tkac 5ea70d
 	acache-enable no;\n\
Adam Tkac 5ea70d
 	acache-cleaning-interval 60;\n\
Adam Tkac 5ea70d
 	max-acache-size 0;\n\
Adam Tkac 5ea70d
+	edns-enable yes;\n\
Adam Tkac 5ea70d
 	dnssec-enable yes;\n\
Adam Tkac 5ea70d
 	dnssec-validation no; /* Make yes for 9.5. */ \n\
Adam Tkac 5ea70d
 	dnssec-accept-expired no;\n\
Adam Tkac 5ea70d
--- bind-9.4.0/bin/named/server.c.edns	2007-03-06 14:43:48.000000000 +0100
Adam Tkac 5ea70d
+++ bind-9.4.0/bin/named/server.c	2007-03-06 15:01:24.000000000 +0100
Adam Tkac 5ea70d
@@ -1492,6 +1492,11 @@
Adam Tkac 5ea70d
 	dns_resolver_setclientsperquery(view->resolver,
Adam Tkac 5ea70d
 					cfg_obj_asuint32(obj),
Adam Tkac 5ea70d
 					max_clients_per_query);
Martin Stransky 25c020
+
Martin Stransky 25c020
+        obj = NULL;
Martin Stransky 25c020
+        (void)ns_config_get(maps, "edns-enable", &obj);
Adam Tkac 5ea70d
+        if(obj != NULL)
Adam Tkac 5ea70d
+               view->enableedns = cfg_obj_asboolean(obj);
Martin Stransky 25c020
 			
Martin Stransky 25c020
 	obj = NULL;
Martin Stransky 25c020
 	result = ns_config_get(maps, "dnssec-enable", &obj);
Adam Tkac 5ea70d
--- bind-9.4.0/bin/named/query.c.edns	2007-01-08 03:41:59.000000000 +0100
Adam Tkac 5ea70d
+++ bind-9.4.0/bin/named/query.c	2007-03-06 14:43:48.000000000 +0100
Adam Tkac 5ea70d
@@ -4578,6 +4578,12 @@
Martin Stransky 25c020
 	if (client->view->enablednssec)
Martin Stransky 25c020
 		message->flags |= DNS_MESSAGEFLAG_AD;
Martin Stransky 25c020
 
Martin Stransky 25c020
+        /*
Martin Stransky 25c020
+         * Disable edns if an user require it.
Martin Stransky 25c020
+         */
Martin Stransky 25c020
+        if (!client->view->enableedns)
Martin Stransky 25c020
+                client->query.fetchoptions |= DNS_FETCHOPT_NOEDNS0;
Martin Stransky 25c020
+
Martin Stransky 25c020
 	qclient = NULL;
Martin Stransky 25c020
 	ns_client_attach(client, &qclient);
Martin Stransky 25c020
 	query_find(qclient, NULL, qtype);