Merge pull request #152 from crosbymichael/addsetns-by-fd

Expose setting interface by fd in network pkg
This commit is contained in:
Michael Crosby 2014-08-12 10:41:21 -07:00
commit d9e307741f
1 changed files with 8 additions and 0 deletions

View File

@ -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 {