This is no longer necessary and actually breaks things
Reported-by: Chris Branch <cbranch@cloudflare.com>
}
func CreateTUN(name string, mtu int) (TUNDevice, error) {
-
- // open clone device
-
- // HACK: we open it as a raw Fd first, so that f.nonblock=false
- // when we make it into a file object.
nfd, err := unix.Open(cloneDevicePath, os.O_RDWR, 0)
if err != nil {
return nil, err
}
- err = unix.SetNonblock(nfd, true)
- if err != nil {
- return nil, err
- }
-
fd := os.NewFile(uintptr(nfd), cloneDevicePath)
if err != nil {
return nil, err