Skip to content

Commit ff71d04

Browse files
yuwatakeszybz
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)
1 parent 99ce5c1 commit ff71d04

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
@@ -307,13 +307,13 @@ int dns_packet_validate_query(DnsPacket *p) {
307307
if (DNS_PACKET_OPCODE(p) != 0)
308308
return -EBADMSG;
309309

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

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

0 commit comments

Comments
 (0)