From: Lennart Poettering Date: Fri, 29 Sep 2017 16:05:51 +0000 (+0200) Subject: resolved: synthesize records for the full local hostname, too X-Git-Tag: v235~34^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a4f3375d727efb801cf1da5422c03f6c004d6aca;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/resolve/resolved-dns-synthesize.c b/src/resolve/resolved-dns-synthesize.c index ca8f5da8045..513ac224663 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;