aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/services/dnsmasq/patches/0004-Don-t-forward-.bind-.server-queries-upstream.patch
diff options
context:
space:
mode:
authorKevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>2018-10-25 10:20:25 +0100
committerKevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>2018-12-10 10:38:49 +0000
commit8c0f6a010a5b7011acbbf2ac5b345d9cf1c14b1f (patch)
treee2bf800c82360eb9f657a40b9db90cbb43918cd0 /package/network/services/dnsmasq/patches/0004-Don-t-forward-.bind-.server-queries-upstream.patch
parent18e02fa20c949e17ff77d821e464a44640ca4c52 (diff)
downloadupstream-8c0f6a010a5b7011acbbf2ac5b345d9cf1c14b1f.tar.gz
upstream-8c0f6a010a5b7011acbbf2ac5b345d9cf1c14b1f.tar.bz2
upstream-8c0f6a010a5b7011acbbf2ac5b345d9cf1c14b1f.zip
dnsmasq: follow upstream dnsmasq pre-v2.81 v2
Backport upstream commits. Most interesting 122392e which changes how SERVFAIL is handled especially in event of genuine server down/failure scenarios with multiple servers. a799ca0 also interesting in that answered received via TCP are now cached, DNSSEC typically using TCP meant until now answers weren't cached, hence reducing performance. 59e4703 Free config file values on parsing errors. 48d12f1 Remove the NO_FORK compile-time option, and support for uclinux. 122392e Revert 68f6312d4bae30b78daafcd6f51dc441b8685b1e 3a5a84c Fix Makefile lines generating UBUS linker config. 24b8760 Do not rely on dead code elimination, use array instead. Make options bits derived from size and count. Use size of option bits and last supported bit in computation. No new change would be required when new options are added. Just change OPT_LAST constant. 6f7812d Fix spurious AD flags in some DNS replies from local config. cbb5b17 Fix logging in cf5984367bc6a949e3803a576512c5a7bc48ebab cf59843 Don't forward *.bind/*.server queries upstream ee87504 Remove ability to compile without IPv6 support. a220545 Ensure that AD bit is reset on answers from --address=/<domain>/<address>. a799ca0 Impove cache behaviour for TCP connections. Along with an additional patch to fix compilation without DHCPv6, sent upstream. I've been running this for aaaages without obvious issue hence brave step of opening to wider openwrt community. Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Diffstat (limited to 'package/network/services/dnsmasq/patches/0004-Don-t-forward-.bind-.server-queries-upstream.patch')
-rw-r--r--package/network/services/dnsmasq/patches/0004-Don-t-forward-.bind-.server-queries-upstream.patch52
1 files changed, 52 insertions, 0 deletions
diff --git a/package/network/services/dnsmasq/patches/0004-Don-t-forward-.bind-.server-queries-upstream.patch b/package/network/services/dnsmasq/patches/0004-Don-t-forward-.bind-.server-queries-upstream.patch
new file mode 100644
index 0000000000..497b4c3df2
--- /dev/null
+++ b/package/network/services/dnsmasq/patches/0004-Don-t-forward-.bind-.server-queries-upstream.patch
@@ -0,0 +1,52 @@
+From cf5984367bc6a949e3803a576512c5a7bc48ebab Mon Sep 17 00:00:00 2001
+From: Vladislav Grishenko <themiron@mail.ru>
+Date: Thu, 18 Oct 2018 04:55:21 +0500
+Subject: [PATCH 04/11] Don't forward *.bind/*.server queries upstream
+
+Chaos .bind and .server (RFC4892) zones are local, therefore
+don't forward queries upstream to avoid mixing with supported
+locally and false replies with NO_ID enabled.
+
+Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
+---
+ src/rfc1035.c | 15 ++++++++++++++-
+ 1 file changed, 14 insertions(+), 1 deletion(-)
+
+--- a/src/rfc1035.c
++++ b/src/rfc1035.c
+@@ -1276,7 +1276,7 @@ size_t answer_request(struct dns_header
+ int q, ans, anscount = 0, addncount = 0;
+ int dryrun = 0;
+ struct crec *crecp;
+- int nxdomain = 0, auth = 1, trunc = 0, sec_data = 1;
++ int nxdomain = 0, notimp = 0, auth = 1, trunc = 0, sec_data = 1;
+ struct mx_srv_record *rec;
+ size_t len;
+
+@@ -1355,6 +1355,17 @@ size_t answer_request(struct dns_header
+ }
+ }
+
++ if (qclass == C_CHAOS)
++ {
++ /* don't forward *.bind and *.server chaos queries */
++ if (hostname_issubdomain("bind", name) || hostname_issubdomain("server", name))
++ {
++ if (!ans)
++ notimp = 1, auth = 0;
++ ans = 1;
++ }
++ }
++
+ if (qclass == C_IN)
+ {
+ struct txt_record *t;
+@@ -1903,6 +1914,8 @@ size_t answer_request(struct dns_header
+
+ if (nxdomain)
+ SET_RCODE(header, NXDOMAIN);
++ else if (notimp)
++ SET_RCODE(header, NOTIMP);
+ else
+ SET_RCODE(header, NOERROR); /* no error */
+ header->ancount = htons(anscount);