From: Christopher O'Connell <[email protected]>

---
 tun/tun_windows.go | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tun/tun_windows.go b/tun/tun_windows.go
index c1c7de7..6d79ba9 100644
--- a/tun/tun_windows.go
+++ b/tun/tun_windows.go
@@ -79,7 +79,10 @@ func CreateTUN(ifname string) (TUNDevice, error) {
 
        err = wt.SetInterfaceName(ifname)
        if err != nil {
-               wt.DeleteInterface(0)
+               _, _, err2 := wt.DeleteInterface(0)
+               if err2 != nil {
+                       return nil,fmt.Errorf("Unable to delete Wintun 
interface after failing to set name: %v: %v", err2, err)
+               }
                return nil, fmt.Errorf("Unable to set name of Wintun interface: 
%v", err)
        }
 
-- 
2.21.0.windows.1

_______________________________________________
WireGuard mailing list
[email protected]
https://lists.zx2c4.com/mailman/listinfo/wireguard

Reply via email to