diff options
author | Lennart Poettering <lennart@poettering.net> | 2017-09-29 18:05:51 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2017-09-29 18:05:51 +0200 |
commit | a4f3375d727efb801cf1da5422c03f6c004d6aca (patch) | |
tree | 36c8733a27e7be49afef205ac29d5b2c16174781 /src/resolve | |
parent | resolved: make sure a non-existing PTR record never gets mangled into NODATA (diff) | |
download | systemd-a4f3375d727efb801cf1da5422c03f6c004d6aca.tar.xz systemd-a4f3375d727efb801cf1da5422c03f6c004d6aca.zip |
resolved: synthesize records for the full local hostname, too
This was forgotten, let's add it too, so that the llmnr, mdns and full
hostname RRs are all synthesized if needed.
Diffstat (limited to 'src/resolve')
-rw-r--r-- | src/resolve/resolved-dns-synthesize.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/resolve/resolved-dns-synthesize.c b/src/resolve/resolved-dns-synthesize.c index ca8f5da804..513ac22466 100644 --- a/src/resolve/resolved-dns-synthesize.c +++ b/src/resolve/resolved-dns-synthesize.c @@ -275,10 +275,13 @@ static int synthesize_system_hostname_ptr(Manager *m, int af, const union in_add if (af == AF_INET && address->in.s_addr == htobe32(0x7F000002)) { - /* Always map the IPv4 address 127.0.0.2 to the local - * hostname, in addition to "localhost": */ + /* Always map the IPv4 address 127.0.0.2 to the local hostname, in addition to "localhost": */ - r = dns_answer_reserve(answer, 3); + r = dns_answer_reserve(answer, 4); + if (r < 0) + return r; + + r = answer_add_ptr(answer, "2.0.0.127.in-addr.arpa", m->full_hostname, dns_synthesize_ifindex(ifindex), DNS_ANSWER_AUTHENTICATED); if (r < 0) return r; @@ -301,6 +304,12 @@ static int synthesize_system_hostname_ptr(Manager *m, int af, const union in_add if (n <= 0) return n; + r = answer_add_addresses_ptr(answer, m->full_hostname, addresses, n, af, address); + if (r < 0) + return r; + if (r > 0) + added = true; + r = answer_add_addresses_ptr(answer, m->llmnr_hostname, addresses, n, af, address); if (r < 0) return r; |