]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolve/mdns: allow mDNS queries with truncation flag
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 8 Nov 2023 12:35:12 +0000 (21:35 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 8 Nov 2023 13:45:14 +0000 (22:45 +0900)
If the query has many Known-Answers records, then the truncation flag is
set.

Fixes #29168.

src/resolve/resolved-dns-packet.c

index ecc75c6590b1e8343427d8c6f32a26629ee0b117..ca1eea4346309be1233ce76ee97b0f7866a35a28 100644 (file)
@@ -307,13 +307,13 @@ int dns_packet_validate_query(DnsPacket *p) {
         if (DNS_PACKET_OPCODE(p) != 0)
                 return -EBADMSG;
 
-        if (DNS_PACKET_TC(p))
-                return -EBADMSG;
-
         switch (p->protocol) {
 
         case DNS_PROTOCOL_LLMNR:
         case DNS_PROTOCOL_DNS:
+                if (DNS_PACKET_TC(p)) /* mDNS query may have truncation flag. */
+                        return -EBADMSG;
+
                 /* RFC 4795, Section 2.1.1. says to discard all queries with QDCOUNT != 1 */
                 if (DNS_PACKET_QDCOUNT(p) != 1)
                         return -EBADMSG;