Netlink sockets can't be shutdown

This commit is contained in:
Jason A. Donenfeld
2018-05-14 14:08:03 +02:00
parent 2dfd4e7d8c
commit 795f76cffa
4 changed files with 69 additions and 25 deletions

View File

@@ -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
}