diff --git a/network/network.go b/network/network.go index 48eeec60..c7560c04 100644 --- a/network/network.go +++ b/network/network.go @@ -44,6 +44,14 @@ func SetInterfaceInNamespacePid(name string, nsPid int) error { return netlink.NetworkSetNsPid(iface, nsPid) } +func SetInterfaceInNamespaceFd(name string, fd uintptr) error { + iface, err := net.InterfaceByName(name) + if err != nil { + return err + } + return netlink.NetworkSetNsFd(iface, int(fd)) +} + func SetInterfaceMaster(name, master string) error { iface, err := net.InterfaceByName(name) if err != nil {