resolved: don't discard mDNS packets with ip6.arpa RRs
authorSergey Bugaev <bugaevc@gmail.com>
Mon, 15 Feb 2021 16:03:27 +0000 (19:03 +0300)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 12 Mar 2021 16:35:57 +0000 (17:35 +0100)
ip6.arpa is also a valid domain name to put in mDNS packets.

(cherry picked from commit 7675501540980eff80c0e055c219e5e1efde6b62)

src/resolve/resolved-mdns.c

index a09374719892a26fb575d2b05d3cd790cf18ec3e..3996fcab2ef5e5f92683f9205da2551ecb8702d1 100644 (file)
@@ -289,9 +289,11 @@ static int on_mdns_packet(sd_event_source *s, int fd, uint32_t revents, void *us
                         const char *name = dns_resource_key_name(rr->key);
                         DnsTransaction *t;
 
-                        /* If the received reply packet contains ANY record that is not .local or .in-addr.arpa,
-                         * we assume someone's playing tricks on us and discard the packet completely. */
+                        /* If the received reply packet contains ANY record that is not .local
+                         * or .in-addr.arpa or .ip6.arpa, we assume someone's playing tricks on
+                         * us and discard the packet completely. */
                         if (!(dns_name_endswith(name, "in-addr.arpa") > 0 ||
+                              dns_name_endswith(name, "ip6.arpa") > 0 ||
                               dns_name_endswith(name, "local") > 0))
                                 return 0;