3ce7d3
From 8963e300f7e465b3c96e859ba81e128fa508cefd Mon Sep 17 00:00:00 2001
3ce7d3
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
3ce7d3
Date: Mon, 21 Jan 2019 19:15:40 +0100
3ce7d3
Subject: [PATCH 1/5] Turn off sending cookies by default
3ce7d3
3ce7d3
Upstream has default sending cookies on by default. For compatiblity
3ce7d3
with bind 9.9.4, require inclusion of send-cookie in configuration or
3ce7d3
dig +cookie parameter to send cookie. Would not send EDNS extension in
3ce7d3
non-DNSSEC query by default.
3ce7d3
---
3ce7d3
 bin/dig/dig.c       | 4 ++--
3ce7d3
 bin/dig/dig.docbook | 4 ++--
3ce7d3
 bin/named/config.c  | 2 +-
3ce7d3
 3 files changed, 5 insertions(+), 5 deletions(-)
3ce7d3
3ce7d3
diff --git a/bin/dig/dig.c b/bin/dig/dig.c
3ce7d3
index c577e31..8b23676 100644
3ce7d3
--- a/bin/dig/dig.c
3ce7d3
+++ b/bin/dig/dig.c
3ce7d3
@@ -1429,7 +1429,7 @@ plus_option(const char *option, isc_boolean_t is_batchfile,
3ce7d3
 					lookup->section_authority = ISC_TRUE;
3ce7d3
 					lookup->section_question = ISC_FALSE;
3ce7d3
 					lookup->dnssec = ISC_TRUE;
3ce7d3
-					lookup->sendcookie = ISC_TRUE;
3ce7d3
+					lookup->sendcookie = ISC_FALSE;
3ce7d3
 					usesearch = ISC_FALSE;
3ce7d3
 				}
3ce7d3
 				break;
3ce7d3
@@ -1883,7 +1883,7 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only,
3ce7d3
 		default_lookup = make_empty_lookup();
3ce7d3
 		default_lookup->adflag = ISC_TRUE;
3ce7d3
 		default_lookup->edns = 0;
3ce7d3
-		default_lookup->sendcookie = ISC_TRUE;
3ce7d3
+		default_lookup->sendcookie = ISC_FALSE;
3ce7d3
 
3ce7d3
 #ifndef NOPOSIX
3ce7d3
 		/*
3ce7d3
diff --git a/bin/dig/dig.docbook b/bin/dig/dig.docbook
3ce7d3
index d5dba72..575a308 100644
3ce7d3
--- a/bin/dig/dig.docbook
3ce7d3
+++ b/bin/dig/dig.docbook
3ce7d3
@@ -617,10 +617,10 @@
3ce7d3
 	      Send a COOKIE EDNS option, with optional
3ce7d3
 	      value.  Replaying a COOKIE from a previous response will
3ce7d3
 	      allow the server to identify a previous client.  The
3ce7d3
-	      default is <option>+cookie</option>.
3ce7d3
+	      default is <option>+nocookie</option>.
3ce7d3
 	    </para>
3ce7d3
 	    <para>
3ce7d3
-	      <command>+cookie</command> is also set when +trace
3ce7d3
+	      <command>+nocookie</command> is also set when +trace
3ce7d3
 	      is set to better emulate the default queries from a
3ce7d3
 	      nameserver.
3ce7d3
 	    </para>
3ce7d3
diff --git a/bin/named/config.c b/bin/named/config.c
3ce7d3
index c50f759..7d97029 100644
3ce7d3
--- a/bin/named/config.c
3ce7d3
+++ b/bin/named/config.c
3ce7d3
@@ -102,7 +102,7 @@ options {\n\
3ce7d3
 	resolver-query-timeout 10;\n\
3ce7d3
 	rrset-order { order random; };\n\
3ce7d3
 	secroots-file \"named.secroots\";\n\
3ce7d3
-	send-cookie true;\n\
3ce7d3
+	send-cookie false;\n\
3ce7d3
 #	serial-queries <obsolete>;\n\
3ce7d3
 	serial-query-rate 20;\n\
3ce7d3
 	server-id none;\n\
3ce7d3
-- 
3ce7d3
2.20.1
3ce7d3