From: Yu Watanabe Date: Wed, 10 Jan 2024 04:01:31 +0000 (+0900) Subject: resolve: also read EDE code and message from cached packet X-Git-Tag: v256-rc1~1205^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=37baa00fe061c967ebb773c2d4bbc332fac10d6a;p=thirdparty%2Fsystemd.git resolve: also read EDE code and message from cached packet --- diff --git a/src/resolve/resolved-dns-transaction.c b/src/resolve/resolved-dns-transaction.c index 4ec58dc1c82..307630f3c7a 100644 --- a/src/resolve/resolved-dns-transaction.c +++ b/src/resolve/resolved-dns-transaction.c @@ -1821,8 +1821,12 @@ static int dns_transaction_prepare(DnsTransaction *t, usec_t ts) { t->answer_source = DNS_TRANSACTION_CACHE; if (t->answer_rcode == DNS_RCODE_SUCCESS) dns_transaction_complete(t, DNS_TRANSACTION_SUCCESS); - else + else { + if (t->received) + (void) dns_packet_ede_rcode(t->received, &t->answer_ede_rcode, &t->answer_ede_msg); + dns_transaction_complete(t, DNS_TRANSACTION_RCODE_FAILURE); + } return 0; } }