mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-27 09:12:39 +00:00
a6a8fe0be5
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. 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>
64 lines
1.8 KiB
Diff
64 lines
1.8 KiB
Diff
From cbb5b17ad8e03e08ade62376a4f6a2066e55960d Mon Sep 17 00:00:00 2001
|
|
From: Simon Kelley <simon@thekelleys.org.uk>
|
|
Date: Tue, 23 Oct 2018 23:45:57 +0100
|
|
Subject: [PATCH 05/11] Fix logging in cf5984367bc6a949e3803a576512c5a7bc48ebab
|
|
|
|
Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
|
|
---
|
|
src/rfc1035.c | 27 ++++++++++++++++++---------
|
|
1 file changed, 18 insertions(+), 9 deletions(-)
|
|
|
|
--- a/src/rfc1035.c
|
|
+++ b/src/rfc1035.c
|
|
@@ -1335,7 +1335,6 @@ size_t answer_request(struct dns_header
|
|
{
|
|
unsigned long ttl = daemon->local_ttl;
|
|
int ok = 1;
|
|
- log_query(F_CONFIG | F_RRNAME, name, NULL, "<TXT>");
|
|
#ifndef NO_ID
|
|
/* Dynamically generate stat record */
|
|
if (t->stat != 0)
|
|
@@ -1345,11 +1344,14 @@ size_t answer_request(struct dns_header
|
|
ok = 0;
|
|
}
|
|
#endif
|
|
- if (ok && add_resource_record(header, limit, &trunc, nameoffset, &ansp,
|
|
- ttl, NULL,
|
|
- T_TXT, t->class, "t", t->len, t->txt))
|
|
- anscount++;
|
|
-
|
|
+ if (ok)
|
|
+ {
|
|
+ log_query(F_CONFIG | F_RRNAME, name, NULL, "<TXT>");
|
|
+ if (add_resource_record(header, limit, &trunc, nameoffset, &ansp,
|
|
+ ttl, NULL,
|
|
+ T_TXT, t->class, "t", t->len, t->txt))
|
|
+ anscount++;
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
@@ -1357,12 +1359,19 @@ size_t answer_request(struct dns_header
|
|
|
|
if (qclass == C_CHAOS)
|
|
{
|
|
- /* don't forward *.bind and *.server chaos queries */
|
|
+ /* don't forward *.bind and *.server chaos queries - always reply with NOTIMP */
|
|
if (hostname_issubdomain("bind", name) || hostname_issubdomain("server", name))
|
|
{
|
|
if (!ans)
|
|
- notimp = 1, auth = 0;
|
|
- ans = 1;
|
|
+ {
|
|
+ notimp = 1, auth = 0;
|
|
+ if (!dryrun)
|
|
+ {
|
|
+ addr.addr.rcode.rcode = NOTIMP;
|
|
+ log_query(F_CONFIG | F_RCODE, name, &addr, NULL);
|
|
+ }
|
|
+ ans = 1;
|
|
+ }
|
|
}
|
|
}
|
|
|