From 14df9c3e75fce5dcb709e46f860838cc88d4033a Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Thu, 29 Aug 2019 17:42:28 -0600 Subject: wintun: take mutex so that deletion uses the right name --- tun/tun_windows.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'tun/tun_windows.go') 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, -- cgit v1.2.3-59-g8ed1b