return;
}
- assert(dns_question_size(p->question) == 1);
+ if (dns_question_size(p->question) != 1)
+ return (void) log_debug("Received LLMNR query without question or multiple questions, ignoring.");
+
key = dns_question_first_key(p->question);
r = dns_zone_lookup(&s->zone, key, 0, &answer, &soa, &tentative);
if (r < 0)
return log_debug_errno(r, "Failed to extract resource records from incoming packet: %m");
- assert_return((dns_question_size(p->question) > 0), -EINVAL);
+ if (dns_question_size(p->question) <= 0)
+ return log_debug_errno(SYNTHETIC_ERRNO(EBADMSG), "Received mDNS query without question, ignoring.");
unicast_reply = mdns_should_reply_using_unicast(p);
if (unicast_reply && !sender_on_local_subnet(s, p)) {