diff --git a/Cargo.lock b/Cargo.lock index 2dbdd7b21b72c6..84bf8702e2821c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -116,7 +116,7 @@ dependencies = [ "dirs-next", "indicatif", "lazy_static", - "nix 0.26.4", + "nix", "reqwest", "scopeguard", "semver 1.0.22", @@ -1709,7 +1709,7 @@ version = "3.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b467862cc8610ca6fc9a1532d7777cee0804e678ab45410897b9396495994a0b" dependencies = [ - "nix 0.27.1", + "nix", "windows-sys 0.52.0", ] @@ -3342,15 +3342,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "memoffset" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" -dependencies = [ - "autocfg", -] - [[package]] name = "memoffset" version = "0.9.0" @@ -3493,19 +3484,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "nix" -version = "0.26.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" -dependencies = [ - "bitflags 1.3.2", - "cfg-if 1.0.0", - "libc", - "memoffset 0.7.1", - "pin-utils", -] - [[package]] name = "nix" version = "0.27.1" @@ -3515,6 +3493,7 @@ dependencies = [ "bitflags 2.4.2", "cfg-if 1.0.0", "libc", + "memoffset 0.9.0", ] [[package]] @@ -6522,7 +6501,7 @@ dependencies = [ "clap 3.2.23", "crossbeam-channel", "log", - "nix 0.26.4", + "nix", "rand 0.8.5", "serde", "serde_derive", @@ -6565,7 +6544,7 @@ dependencies = [ "lazy_static", "libc", "log", - "nix 0.26.4", + "nix", "rand 0.8.5", "rand_chacha 0.3.1", "rayon", @@ -7264,7 +7243,7 @@ dependencies = [ "itertools", "libc", "log", - "nix 0.26.4", + "nix", "pem", "percentage", "quinn", diff --git a/Cargo.toml b/Cargo.toml index 0f743e41825c64..70da133dd4f17b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -250,7 +250,7 @@ merlin = "3" min-max-heap = "1.3.0" mockall = "0.11.4" modular-bitfield = "0.11.2" -nix = "0.26.4" +nix = "0.27.1" num-bigint = "0.4.4" num-derive = "0.4" num-traits = "0.2" diff --git a/net-utils/Cargo.toml b/net-utils/Cargo.toml index 0d8a82f7a994cd..6bd0a9e9bd70eb 100644 --- a/net-utils/Cargo.toml +++ b/net-utils/Cargo.toml @@ -14,7 +14,7 @@ bincode = { workspace = true } clap = { version = "3.1.5", features = ["cargo"] } crossbeam-channel = { workspace = true } log = { workspace = true } -nix = { workspace = true } +nix = { workspace = true, features = ["socket"] } rand = { workspace = true } serde = { workspace = true } serde_derive = { workspace = true } diff --git a/net-utils/src/lib.rs b/net-utils/src/lib.rs index 1ff48173def0da..74b034d46b1ff7 100644 --- a/net-utils/src/lib.rs +++ b/net-utils/src/lib.rs @@ -1,5 +1,7 @@ //! The `net_utils` module assists with networking #![allow(clippy::arithmetic_side_effects)] + +use std::os::fd::AsFd; use { crossbeam_channel::unbounded, log::*, @@ -394,16 +396,15 @@ fn udp_socket(reuseaddr: bool) -> io::Result { setsockopt, sockopt::{ReuseAddr, ReusePort}, }, - std::os::unix::io::AsRawFd, }; let sock = Socket::new(Domain::IPV4, Type::DGRAM, None)?; - let sock_fd = sock.as_raw_fd(); + let sock_fd = sock.as_fd(); if reuseaddr { // best effort, i.e. ignore errors here, we'll get the failure in caller - setsockopt(sock_fd, ReusePort, &true).ok(); - setsockopt(sock_fd, ReuseAddr, &true).ok(); + setsockopt(&sock_fd, ReusePort, &true).ok(); + setsockopt(&sock_fd, ReuseAddr, &true).ok(); } Ok(sock) diff --git a/programs/sbf/Cargo.lock b/programs/sbf/Cargo.lock index 8e7315d17631d5..5fd1d6ca7b5a0e 100644 --- a/programs/sbf/Cargo.lock +++ b/programs/sbf/Cargo.lock @@ -2840,15 +2840,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "memoffset" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" -dependencies = [ - "autocfg", -] - [[package]] name = "memoffset" version = "0.9.0" @@ -3002,15 +2993,14 @@ dependencies = [ [[package]] name = "nix" -version = "0.26.4" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" +checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.2", "cfg-if 1.0.0", "libc", - "memoffset 0.7.1", - "pin-utils", + "memoffset 0.9.0", ] [[package]]