summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-01-22 17:24:05 +0100
committerLennart Poettering <lennart@poettering.net>2016-01-25 17:19:20 +0100
commita7bf2ada62db599efbb2fbabcc4dc45997b87415 (patch)
treeb452c526875ffc1894d3d701c7505285eecef9ea /src
parent7cc6ed7ba6c667caef9a92ba4d59e1ecdc3af8ff (diff)
resolved: properly propagate query candidate error
We already properly propagate errors from transactions to queries. Make sure that errors that happened during handling of query candidates are propagated to the query, too.
Diffstat (limited to 'src')
-rw-r--r--src/resolve/resolved-dns-query.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/resolve/resolved-dns-query.c b/src/resolve/resolved-dns-query.c
index 1d706f8a43..11179d1926 100644
--- a/src/resolve/resolved-dns-query.c
+++ b/src/resolve/resolved-dns-query.c
@@ -760,6 +760,15 @@ static void dns_query_accept(DnsQuery *q, DnsQueryCandidate *c) {
return;
}
+ if (c->error_code != 0) {
+ /* If the candidate had an error condition of its own, start with that. */
+ state = DNS_TRANSACTION_ERRNO;
+ q->answer = dns_answer_unref(q->answer);
+ q->answer_rcode = 0;
+ q->answer_dnssec_result = _DNSSEC_RESULT_INVALID;
+ q->answer_errno = c->error_code;
+ }
+
SET_FOREACH(t, c->transactions, i) {
switch (t->state) {