aboutsummaryrefslogtreecommitdiff
path: root/tun/tun_windows.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-07-18 12:26:57 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-07-18 12:26:57 +0200
commit6c50fedd8eecc6cb06d8da47514794eb211d5b3a (patch)
treec8895ef44ef915021770ac274693cb59811d4cea /tun/tun_windows.go
parent298d759f3efba6b90ea70838d190959b39c5be57 (diff)
downloadwireguard-go-6c50fedd8eecc6cb06d8da47514794eb211d5b3a.tar.gz
wireguard-go-6c50fedd8eecc6cb06d8da47514794eb211d5b3a.zip
tun: windows: switch to NDIS device object
Diffstat (limited to 'tun/tun_windows.go')
-rw-r--r--tun/tun_windows.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/tun/tun_windows.go b/tun/tun_windows.go
index d22e130..21bc382 100644
--- a/tun/tun_windows.go
+++ b/tun/tun_windows.go
@@ -146,13 +146,17 @@ func CreateTUNWithRequestedGUID(ifname string, requestedGUID *windows.GUID) (Dev
}
func (tun *NativeTun) openTUN() error {
+ filename, err := tun.wt.NdisFileName()
+ if err != nil {
+ return err
+ }
+
retries := maybeRetry(retryTimeout * retryRate)
if tun.close {
return os.ErrClosed
}
- var err error
- name, err := windows.UTF16PtrFromString(tun.wt.DataFileName())
+ name, err := windows.UTF16PtrFromString(filename)
if err != nil {
return err
}