if (s->protocol == DNS_PROTOCOL_LLMNR) {
if (dns_name_endswith(domain, "in-addr.arpa") > 0 ||
dns_name_endswith(domain, "ip6.arpa") > 0 ||
- dns_name_single_label(domain) > 0)
+ (dns_name_single_label(domain) > 0 &&
+ dns_name_equal(domain, "gateway") <= 0)) /* don't resolve "gateway" with LLMNR, let nss-myhostname handle this */
return DNS_SCOPE_MAYBE;
return DNS_SCOPE_NO;
if (p->ipproto == IPPROTO_UDP) {
/* Don't accept UDP queries directed to anything but
* the LLMNR multicast addresses. See RFC 4795,
- * section 2.5.*/
+ * section 2.5. */
if (p->family == AF_INET && !in_addr_equal(AF_INET, &p->destination, (union in_addr_union*) &LLMNR_MULTICAST_IPV4_ADDRESS))
return;