diff --git a/Cargo.toml b/Cargo.toml index f915265..1ee8133 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,5 +10,5 @@ license = "Apache-2.0" edition = "2018" [dependencies] -nix = "0.23.1" +nix = { version = "0.29", features = ["mount", "sched"] } thiserror = "1.0.30" diff --git a/src/netns.rs b/src/netns.rs index 96e7672..85409f2 100644 --- a/src/netns.rs +++ b/src/netns.rs @@ -219,7 +219,7 @@ impl NetNs { /// /// Requires elevated privileges. pub fn enter(&self) -> Result<()> { - setns(self.file.as_raw_fd(), CloneFlags::CLONE_NEWNET).map_err(Error::SetnsError) + setns(&self.file, CloneFlags::CLONE_NEWNET).map_err(Error::SetnsError) } /// Returns the NetNs with the specified name and Env.