]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolved: properly propagate query candidate error
authorLennart Poettering <lennart@poettering.net>
Fri, 22 Jan 2016 16:24:05 +0000 (17:24 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 25 Jan 2016 16:19:20 +0000 (17:19 +0100)
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.

src/resolve/resolved-dns-query.c

index 1d706f8a4385abd72afffb3619176fc61b75dfb6..11179d1926073d3c81876138456101323cfa6afc 100644 (file)
@@ -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) {