diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-01-22 12:22:05 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2016-01-25 17:19:19 +0100 |
commit | 528e685ebd3657f2531f8666c9e4bba6fbd38acd (patch) | |
tree | cc3223c934baa57a2ef66b48f42d0dbdf9f73966 | |
parent | 0791110fbee9d7dfcabd6e338c290e90aeb79644 (diff) |
resolved: when synthesizing RR responses, own the name fully
When we synthesize A/AAAA for domains like "localhost", then make sure we generate ENODATA if the user asks for RR
types such a RP to be solved on the name. Previously, we'd pass the error back in that case that was generated from the
usual lookup procedure.
-rw-r--r-- | src/resolve/resolved-dns-synthesize.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/resolve/resolved-dns-synthesize.c b/src/resolve/resolved-dns-synthesize.c index e12bb6e828..d93741b736 100644 --- a/src/resolve/resolved-dns-synthesize.c +++ b/src/resolve/resolved-dns-synthesize.c @@ -348,6 +348,7 @@ int dns_synthesize_answer( _cleanup_(dns_answer_unrefp) DnsAnswer *answer = NULL; DnsResourceKey *key; + bool found = false; int r; assert(m); @@ -398,10 +399,13 @@ int dns_synthesize_answer( r = synthesize_gateway_ptr(m, af, &address, ifindex, &answer); if (r < 0) return log_error_errno(r, "Failed to synthesize gateway hostname PTR RR: %m"); - } + } else + continue; + + found = true; } - r = dns_answer_size(answer) > 0; + r = found; if (ret) { *ret = answer; |