From ad372ec2e6962c549f14a124750c04ae706621f9 Mon Sep 17 00:00:00 2001 From: zonyitoo Date: Mon, 27 May 2024 23:44:57 +0800 Subject: [PATCH] fix(local-fake-dns): Response message includes the original Query (#1539) --- crates/shadowsocks-service/src/local/fake_dns/processor.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/shadowsocks-service/src/local/fake_dns/processor.rs b/crates/shadowsocks-service/src/local/fake_dns/processor.rs index 9ea7074043d6..0e8e44d1acef 100644 --- a/crates/shadowsocks-service/src/local/fake_dns/processor.rs +++ b/crates/shadowsocks-service/src/local/fake_dns/processor.rs @@ -27,6 +27,9 @@ pub async fn handle_dns_request(req_message: &Message, manager: &FakeDnsManager) rsp_message.set_response_code(ResponseCode::NotImp); } else { for query in req_message.queries() { + // Copy all the queries into response. + rsp_message.add_query(query.clone()); + if query.query_class() != DNSClass::IN { let record = Record::::with(query.name().clone(), query.query_type(), 0); rsp_message.add_answer(record);