mirror of
https://github.com/systemd/systemd.git
synced 2024-11-05 06:52:22 +03:00
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.
This commit is contained in:
parent
0791110fbe
commit
528e685ebd
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user