summaryrefslogtreecommitdiff
path: root/tun/tun_windows.go
diff options
context:
space:
mode:
Diffstat (limited to 'tun/tun_windows.go')
-rw-r--r--tun/tun_windows.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/tun/tun_windows.go b/tun/tun_windows.go
index c17f6d1..b352cd1 100644
--- a/tun/tun_windows.go
+++ b/tun/tun_windows.go
@@ -71,6 +71,8 @@ func CreateTUN(ifname string) (TUNDevice, error) {
if err != nil {
return nil, fmt.Errorf("Unable to delete already existing Wintun interface: %v", err)
}
+ } else if err == windows.ERROR_ALREADY_EXISTS {
+ return nil, fmt.Errorf("Foreign network interface with the same name exists")
}
wt, _, err = wintun.CreateInterface("WireGuard Tunnel Adapter", 0)
if err != nil {