resolve/mdns: allow mDNS queries with truncation flag

If the query has many Known-Answers records, then the truncation flag is
set.

Fixes #29168.
This commit is contained in:
Yu Watanabe
2023-11-08 22:45:14 +09:00
parent 614af79cfc
commit 6f087266e3
+3 -3
View 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;