Skip to content

Commit

Permalink
Merge pull request #162 from 56quarters/write-crash
Browse files Browse the repository at this point in the history
Convert name to be fully qualified to encode for `dns write`
  • Loading branch information
56quarters authored Jul 18, 2024
2 parents 1357725 + bf7e92a commit 7ab48e1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mtop/src/bin/dns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,9 @@ async fn run_read(_: &ReadCommand) -> ExitCode {

async fn run_write(cmd: &WriteCommand) -> ExitCode {
let id = MessageId::random();
let name = cmd.name.clone().to_fqdn();
let msg = Message::new(id, Flags::default().set_query().set_recursion_desired())
.add_question(Question::new(cmd.name.clone(), cmd.rtype).set_qclass(cmd.rclass));
.add_question(Question::new(name, cmd.rtype).set_qclass(cmd.rclass));

write_binary_message(&msg).await
}
Expand Down

0 comments on commit 7ab48e1

Please sign in to comment.