Skip to content

Commit

Permalink
update rand to 0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
ssrlive committed Jan 28, 2025
1 parent 60022e1 commit 00916c9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ env_logger = "0.11"
hickory-proto = "0.24"
log = "0.4"
moka = { version = "0.12", default-features = false, features = ["future"] }
rand = "0.8"
rand = "0.9"
socks5-impl = { version = "0.6", default-features = false, features = [
"client",
] }
Expand Down
3 changes: 1 addition & 2 deletions src/dns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ use std::{net::IpAddr, str::FromStr};

#[allow(dead_code)]
pub fn build_dns_query(domain: &str, query_type: RecordType, used_by_tcp: bool) -> std::io::Result<Vec<u8>> {
use rand::{rngs::StdRng, Rng, SeedableRng};
let name = Name::from_str(domain).map_err(|e| Error::new(ErrorKind::InvalidInput, e.to_string()))?;
let query = Query::query(name, query_type);
let mut msg = Message::new();
msg.add_query(query)
.set_id(StdRng::from_entropy().gen())
.set_id(rand::Rng::random::<u16>(&mut rand::rng()))
.set_op_code(OpCode::Query)
.set_message_type(MessageType::Query)
.set_recursion_desired(true);
Expand Down

0 comments on commit 00916c9

Please sign in to comment.