Skip to content

Commit

Permalink
change from_bytes msg to format error
Browse files Browse the repository at this point in the history
  • Loading branch information
justRkive committed Nov 16, 2023
1 parent cff4874 commit 865a245
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ impl DnsMessage {
let bytes_len = bytes.len();

if bytes_len < 12 {
return Err("Parse Error: Message is too short.");
return Err("Format Error");
}

// Header
Expand All @@ -356,7 +356,7 @@ impl DnsMessage {
let q_count = header.get_qdcount();

if bytes_len < 13 {
return Err("Parse Error: Message is too short.");
return Err("Format Error");
}

let (mut question, mut no_question_bytes) = (Question::new(), &bytes[12..]);
Expand Down

0 comments on commit 865a245

Please sign in to comment.