fix(deps): support newer version of rand crate

Closes #186.
This commit is contained in:
SH Weng 2025-03-15 15:38:13 +08:00 committed by GitHub
parent 62f0278c1a
commit 333c6dd059
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -402,7 +402,7 @@ impl Stack {
/// Connects to the remote end. `None` returned means
/// the connection attempt failed.
pub async fn connect(&mut self, addr: SocketAddr) -> Option<Socket> {
let mut rng = SmallRng::from_entropy();
let mut rng = SmallRng::from_os_rng();
for local_port in rng.gen_range(32768..=60999)..=60999 {
let local_addr = SocketAddr::new(
if addr.is_ipv4() {