From 795f76cffa1a222e494e4609e5d3ed2f2557c463 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 14 May 2018 14:08:03 +0200 Subject: Netlink sockets can't be shutdown --- tun_darwin.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tun_darwin.go') diff --git a/tun_darwin.go b/tun_darwin.go index ac8bffd..8f9a5d5 100644 --- a/tun_darwin.go +++ b/tun_darwin.go @@ -122,11 +122,13 @@ func CreateTUNFromFile(file *os.File) (TUNDevice, error) { _, err := tun.Name() if err != nil { + tun.fd.Close() return nil, err } tun.rwcancel, err = rwcancel.NewRWCancel(int(file.Fd())) if err != nil { + tun.fd.Close() return nil, err } -- cgit v1.2.3-59-g8ed1b