resolve/mdns: silently ignore Known-Answers only packets

This commit is contained in:
Yu Watanabe
2023-11-08 22:45:14 +09:00
parent 6f087266e3
commit dd51c4332f
+2 -1
View File
@@ -254,8 +254,9 @@ static int mdns_scope_process_query(DnsScope *s, DnsPacket *p) {
if (r < 0)
return log_debug_errno(r, "Failed to extract resource records from incoming packet: %m");
/* TODO: Support Known-Answers only packets gracefully. */
if (dns_question_size(p->question) <= 0)
return log_debug_errno(SYNTHETIC_ERRNO(EBADMSG), "Received mDNS query without question, ignoring.");
return 0;
unicast_reply = mdns_should_reply_using_unicast(p);
if (unicast_reply && !sender_on_local_subnet(s, p)) {