]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolve: synthesize null address, IPv4 broadcast address, or invalid domain 22231/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 23 Jan 2022 21:36:53 +0000 (06:36 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 23 Jan 2022 21:46:50 +0000 (06:46 +0900)
These are filtered in `dns_scope_good_domain()`, but not synthesized.

Fixes #22229.

src/resolve/resolved-dns-synthesize.c

index ea239e686d8d56a65e15f5b11e9baed0c930f02b..0914515fdfb29a8da00fe42e56f053596ab99174 100644 (file)
@@ -397,6 +397,14 @@ int dns_synthesize_answer(
                 if (dns_name_is_empty(name)) {
                         /* Do nothing. */
 
+                } else if (dns_name_endswith(name, "0.in-addr.arpa") > 0 ||
+                           dns_name_equal(name, "255.255.255.255.in-addr.arpa") > 0 ||
+                           dns_name_equal(name, "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa") > 0 ||
+                           dns_name_endswith(name, "invalid") > 0) {
+
+                        nxdomain = true;
+                        continue;
+
                 } else if (is_localhost(name)) {
 
                         r = synthesize_localhost_rr(m, key, ifindex, &answer);