]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolve: also read EDE code and message from cached packet
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 10 Jan 2024 04:01:31 +0000 (13:01 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 10 Jan 2024 17:10:32 +0000 (02:10 +0900)
src/resolve/resolved-dns-transaction.c

index 4ec58dc1c82b4afbb610f1327c711f0ac78b3205..307630f3c7a1618a5ee99852f7c645cf497b0025 100644 (file)
@@ -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;
                         }
                 }