From: Zbigniew Jędrzejewski-Szmek Date: Mon, 20 Apr 2020 11:52:35 +0000 (+0200) Subject: resolved: return org.freedesktop.resolve1.DnsError.NXDOMAIN on LLMNR resolution failure X-Git-Tag: v246-rc1~550^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e53b8cc5216742f919dff35d9c86397b06d5f33d;p=thirdparty%2Fsystemd.git resolved: return org.freedesktop.resolve1.DnsError.NXDOMAIN on LLMNR resolution failure Fixes #14922. --- diff --git a/src/resolve/resolved-dns-transaction.c b/src/resolve/resolved-dns-transaction.c index fb54d160da4..5898308d5fa 100644 --- a/src/resolve/resolved-dns-transaction.c +++ b/src/resolve/resolved-dns-transaction.c @@ -1350,7 +1350,16 @@ static int dns_transaction_prepare(DnsTransaction *t, usec_t ts) { } if (t->n_attempts >= TRANSACTION_ATTEMPTS_MAX(t->scope->protocol)) { - dns_transaction_complete(t, DNS_TRANSACTION_ATTEMPTS_MAX_REACHED); + DnsTransactionState result; + + if (t->scope->protocol == DNS_PROTOCOL_LLMNR) + /* If we didn't find anything on LLMNR, it's not an error, but a failure to resolve + * the name. */ + result = DNS_TRANSACTION_NOT_FOUND; + else + result = DNS_TRANSACTION_ATTEMPTS_MAX_REACHED; + + dns_transaction_complete(t, result); return 0; }