Skip to content

Commit ac7ee9f

Browse files
yuwatabluca
authored andcommitted
resolve/mdns: allow mDNS queries with truncation flag
If the query has many Known-Answers records, then the truncation flag is set. Fixes #29168. (cherry picked from commit 6f08726) (cherry picked from commit ff71d04) (cherry picked from commit a28a6c9)
1 parent f704111 commit ac7ee9f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/resolve/resolved-dns-packet.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,13 +308,13 @@ int dns_packet_validate_query(DnsPacket *p) {
308308
if (DNS_PACKET_OPCODE(p) != 0)
309309
return -EBADMSG;
310310

311-
if (DNS_PACKET_TC(p))
312-
return -EBADMSG;
313-
314311
switch (p->protocol) {
315312

316313
case DNS_PROTOCOL_LLMNR:
317314
case DNS_PROTOCOL_DNS:
315+
if (DNS_PACKET_TC(p)) /* mDNS query may have truncation flag. */
316+
return -EBADMSG;
317+
318318
/* RFC 4795, Section 2.1.1. says to discard all queries with QDCOUNT != 1 */
319319
if (DNS_PACKET_QDCOUNT(p) != 1)
320320
return -EBADMSG;

0 commit comments

Comments
 (0)