1 From 6f7812d97bc8f87004c0a5069c6c94c64af78106 Mon Sep 17 00:00:00 2001
2 From: Simon Kelley <simon@thekelleys.org.uk>
3 Date: Tue, 23 Oct 2018 23:54:44 +0100
4 Subject: [PATCH 06/30] Fix spurious AD flags in some DNS replies from local
7 Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
9 src/rfc1035.c | 42 ++++++++++++++++++++++++------------------
10 1 file changed, 24 insertions(+), 18 deletions(-)
14 @@ -1330,7 +1330,7 @@ size_t answer_request(struct dns_header
16 if (t->class == qclass && hostname_isequal(name, t->name))
19 + ans = 1, sec_data = 0;
22 unsigned long ttl = daemon->local_ttl;
23 @@ -1370,7 +1370,7 @@ size_t answer_request(struct dns_header
24 addr.addr.rcode.rcode = NOTIMP;
25 log_query(F_CONFIG | F_RCODE, name, &addr, NULL);
28 + ans = 1, sec_data = 0;
32 @@ -1725,7 +1725,7 @@ size_t answer_request(struct dns_header
34 else if (is_name_synthetic(flag, name, &addr))
37 + ans = 1, sec_data = 0;
40 log_query(F_FORWARD | F_CONFIG | flag, name, &addr, NULL);
41 @@ -1763,25 +1763,27 @@ size_t answer_request(struct dns_header
42 for (rec = daemon->mxnames; rec; rec = rec->next)
43 if (!rec->issrv && hostname_isequal(name, rec->name))
49 - log_query(F_CONFIG | F_RRNAME, name, NULL, "<MX>");
50 - if (add_resource_record(header, limit, &trunc, nameoffset, &ansp, daemon->local_ttl,
51 - &offset, T_MX, C_IN, "sd", rec->weight, rec->target))
55 - rec->offset = offset;
63 + log_query(F_CONFIG | F_RRNAME, name, NULL, "<MX>");
64 + if (add_resource_record(header, limit, &trunc, nameoffset, &ansp, daemon->local_ttl,
65 + &offset, T_MX, C_IN, "sd", rec->weight, rec->target))
69 + rec->offset = offset;
74 if (!found && (option_bool(OPT_SELFMX) || option_bool(OPT_LOCALMX)) &&
75 cache_find_by_name(NULL, name, now, F_HOSTS | F_DHCP | F_NO_RR))
81 log_query(F_CONFIG | F_RRNAME, name, NULL, "<MX>");
82 @@ -1802,6 +1804,7 @@ size_t answer_request(struct dns_header
83 if (rec->issrv && hostname_isequal(name, rec->name))
90 @@ -1838,6 +1841,7 @@ size_t answer_request(struct dns_header
91 if (!found && option_bool(OPT_FILTER) && (qtype == T_SRV || (qtype == T_ANY && strchr(name, '_'))))
96 log_query(F_CONFIG | F_NEG, name, NULL, NULL);
98 @@ -1850,6 +1854,7 @@ size_t answer_request(struct dns_header
99 if (hostname_isequal(name, na->name))
105 log_query(F_CONFIG | F_RRNAME, name, NULL, "<NAPTR>");
106 @@ -1862,11 +1867,12 @@ size_t answer_request(struct dns_header
109 if (qtype == T_MAILB)
110 - ans = 1, nxdomain = 1;
111 + ans = 1, nxdomain = 1, sec_data = 0;
113 if (qtype == T_SOA && option_bool(OPT_FILTER))
119 log_query(F_CONFIG | F_NEG, name, &addr, NULL);