summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Kelley <simon@thekelleys.org.uk>2015-03-27 09:58:26 +0000
committerSimon Kelley <simon@thekelleys.org.uk>2015-03-27 09:58:26 +0000
commit150162bc37170a6edae9d488435e836b1e4e3a4e (patch)
tree0e64438c38046ac46c36334c42cdbd901ec207c5
parent8805283088d670baecb92569252c01cf754cda51 (diff)
downloaddnsmasq-150162bc37170a6edae9d488435e836b1e4e3a4e.tar.gz
Return SERVFAIL when validation abandoned.
-rw-r--r--src/forward.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/forward.c b/src/forward.c
index 7c0fa8d..985814c 100644
--- a/src/forward.c
+++ b/src/forward.c
@@ -663,6 +663,7 @@ static size_t process_reply(struct dns_header *header, time_t now, struct server
header->ancount = htons(0);
header->nscount = htons(0);
header->arcount = htons(0);
+ header->hb3 &= ~HB3_TC;
}
/* the bogus-nxdomain stuff, doctor and NXDOMAIN->NODATA munging can all elide
@@ -991,7 +992,10 @@ void reply_query(int fd, int family, time_t now)
char *result;
if (forward->work_counter == 0)
- result = "ABANDONED";
+ {
+ result = "ABANDONED";
+ status = STAT_BOGUS;
+ }
else
result = (status == STAT_SECURE ? "SECURE" : (status == STAT_INSECURE ? "INSECURE" : "BOGUS"));
@@ -1938,7 +1942,10 @@ unsigned char *tcp_request(int confd, time_t now,
char *result;
if (keycount == 0)
- result = "ABANDONED";
+ {
+ result = "ABANDONED";
+ status = STAT_BOGUS;
+ }
else
result = (status == STAT_SECURE ? "SECURE" : (status == STAT_INSECURE ? "INSECURE" : "BOGUS"));