diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-05-14 14:08:03 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-05-14 14:08:03 +0200 |
commit | 795f76cffa1a222e494e4609e5d3ed2f2557c463 (patch) | |
tree | 853c2a88137337f235a827df643fa5224eaefcc4 /tun_darwin.go | |
parent | 2dfd4e7d8c5f5540690dfbbac50aa6f020b2cbbc (diff) |
Netlink sockets can't be shutdown
Diffstat (limited to 'tun_darwin.go')
-rw-r--r-- | tun_darwin.go | 2 |
1 files changed, 2 insertions, 0 deletions
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 } |