diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-12-06 17:17:51 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-12-06 17:17:51 +0100 |
commit | 651744561e9e31197d8ebb59f97ab3dae3c39687 (patch) | |
tree | 867abf599b9766f93151069225581d92e07af5cd /tun/tun_linux.go | |
parent | 4fd55daafe64f6101dde5c0a8a6887fef0ff0545 (diff) |
tun: remove nonblock hack for linux
This is no longer necessary and actually breaks things
Reported-by: Chris Branch <cbranch@cloudflare.com>
Diffstat (limited to 'tun/tun_linux.go')
-rw-r--r-- | tun/tun_linux.go | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/tun/tun_linux.go b/tun/tun_linux.go index bb6bede..6f91cfd 100644 --- a/tun/tun_linux.go +++ b/tun/tun_linux.go @@ -368,21 +368,11 @@ func (tun *nativeTun) Close() error { } 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 |