mirror of
https://codeberg.org/icewind/netnsd.git
synced 2026-06-03 09:04:07 +02:00
minor link handling improvements
This commit is contained in:
parent
41258f44bd
commit
35c8f5cc6c
2 changed files with 28 additions and 30 deletions
|
|
@ -2,7 +2,7 @@ mod handle;
|
|||
mod raw;
|
||||
|
||||
use crate::config::{DeviceName, NamespaceName};
|
||||
use crate::link::{link_up, move_all_links_out, move_link_into, LinkError};
|
||||
use crate::link::{link_up, move_all_links, move_link_into, LinkError};
|
||||
pub use crate::namespace::handle::{NamespaceHandle, NamespaceHandleError};
|
||||
use crate::namespace::raw::{create_network_namespace, NamespaceSetupError};
|
||||
use either::Either;
|
||||
|
|
@ -162,7 +162,9 @@ impl NetNs {
|
|||
pub fn delete(self) -> Result<(), NamespaceError> {
|
||||
let parent_namespace = NamespaceHandle::parent()?;
|
||||
|
||||
move_all_links_out(self.handle(), &parent_namespace)?;
|
||||
self.handle.run_in(|| {
|
||||
move_all_links(&parent_namespace)
|
||||
})??;
|
||||
let name = self.path.file_name().unwrap().to_str().unwrap();
|
||||
info!(name, "deleting network namespace");
|
||||
match umount2(&self.path, MntFlags::MNT_DETACH) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue