Skip to content

Commit

Permalink
fix(local-fake-dns): Response message includes the original Query (#1539
Browse files Browse the repository at this point in the history
)
  • Loading branch information
zonyitoo committed May 27, 2024
1 parent 1ec906a commit ad372ec
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/shadowsocks-service/src/local/fake_dns/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<RData>::with(query.name().clone(), query.query_type(), 0);
rsp_message.add_answer(record);
Expand Down

0 comments on commit ad372ec

Please sign in to comment.