summaryrefslogtreecommitdiffhomepage
path: root/tun/tun_openbsd.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-02-27 01:06:43 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2019-02-27 01:34:11 +0100
commitab0f442dafba417c3a13d883a447e882d7983690 (patch)
tree4ee549ee9f666b4c4a401c1d3ac34d922b120f0e /tun/tun_openbsd.go
parent66524c1f7e1b94720e4551607eff15189b01c8d3 (diff)
tun: use sysconn instead of .Fd with Go 1.12
Diffstat (limited to 'tun/tun_openbsd.go')
-rw-r--r--tun/tun_openbsd.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/tun/tun_openbsd.go b/tun/tun_openbsd.go
index ab4c87b..b10c460 100644
--- a/tun/tun_openbsd.go
+++ b/tun/tun_openbsd.go
@@ -8,9 +8,9 @@ package tun
import (
"errors"
"fmt"
- "golang.zx2c4.com/wireguard/rwcancel"
"golang.org/x/net/ipv6"
"golang.org/x/sys/unix"
+ "golang.zx2c4.com/wireguard/rwcancel"
"io/ioutil"
"net"
"os"
@@ -167,7 +167,9 @@ func CreateTUNFromFile(file *os.File, mtu int) (TUNDevice, error) {
return nil, err
}
- tun.rwcancel, err = rwcancel.NewRWCancel(int(file.Fd()))
+ tun.operateOnFd(func(fd uintptr) {
+ tun.rwcancel, err = rwcancel.NewRWCancel(int(fd))
+ })
if err != nil {
tun.tunFile.Close()
return nil, err