summaryrefslogtreecommitdiffhomepage
path: root/tun/tun_windows.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-08-29 17:42:28 -0600
committerSimon Rozman <simon@rozman.si>2019-08-30 15:34:17 +0200
commit14df9c3e75fce5dcb709e46f860838cc88d4033a (patch)
treecd9d83f88b00f59304bda531c1db12c4ff94075e /tun/tun_windows.go
parent353f0956bccf4919f7764166f1dd0f2c8bb7cca2 (diff)
wintun: take mutex so that deletion uses the right name
Diffstat (limited to 'tun/tun_windows.go')
-rw-r--r--tun/tun_windows.go8
1 files changed, 1 insertions, 7 deletions
diff --git a/tun/tun_windows.go b/tun/tun_windows.go
index 9c635b5..43f0cec 100644
--- a/tun/tun_windows.go
+++ b/tun/tun_windows.go
@@ -75,17 +75,11 @@ func CreateTUNWithRequestedGUID(ifname string, requestedGUID *windows.GUID) (Dev
return nil, fmt.Errorf("Unable to delete already existing Wintun interface: %v", err)
}
}
- wt, _, err = WintunPool.CreateInterface(requestedGUID)
+ wt, _, err = WintunPool.CreateInterface(ifname, requestedGUID)
if err != nil {
return nil, fmt.Errorf("Unable to create Wintun interface: %v", err)
}
- err = wt.SetName(ifname)
- if err != nil {
- wt.DeleteInterface()
- return nil, fmt.Errorf("Unable to set name of Wintun interface: %v", err)
- }
-
tun := &NativeTun{
wt: wt,
handle: windows.InvalidHandle,