1
0
mirror of https://git.zx2c4.com/wireguard-go synced 2024-11-15 01:05:15 +01:00

tun: windows: open file at startup time

This commit is contained in:
Jason A. Donenfeld 2019-07-18 19:26:25 +02:00
parent 1e39c33ab1
commit 31ff9c02fe

View File

@ -142,6 +142,15 @@ func CreateTUNWithRequestedGUID(ifname string, requestedGUID *windows.GUID) (Dev
return nil, fmt.Errorf("Error creating event: %v", err) return nil, fmt.Errorf("Error creating event: %v", err)
} }
_, err = tun.getTUN()
if err != nil {
windows.CloseHandle(tun.rings.send.tailMoved)
windows.CloseHandle(tun.rings.receive.tailMoved)
tun.closeTUN()
wt.DeleteInterface()
return nil, err
}
return tun, nil return tun, nil
} }