summaryrefslogtreecommitdiffhomepage
path: root/tun/tun_windows.go
diff options
context:
space:
mode:
Diffstat (limited to 'tun/tun_windows.go')
-rw-r--r--tun/tun_windows.go17
1 files changed, 5 insertions, 12 deletions
diff --git a/tun/tun_windows.go b/tun/tun_windows.go
index 9428373..948f08d 100644
--- a/tun/tun_windows.go
+++ b/tun/tun_windows.go
@@ -75,18 +75,11 @@ func CreateTUN(ifname string) (TUNDevice, error) {
return nil, err
}
- go func() {
- retries := retryTimeout * retryRate
- for {
- err := wt.SetInterfaceName(ifname)
- if err != nil && retries > 0 {
- time.Sleep(time.Second / retryRate)
- retries--
- continue
- }
- return
- }
- }()
+ err = wt.SetInterfaceName(ifname)
+ if err != nil {
+ wt.DeleteInterface(0)
+ return nil, err
+ }
err = wt.FlushInterface()
if err != nil {