aboutsummaryrefslogtreecommitdiffstats
path: root/tun/wintun
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-08-02 14:37:09 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-08-02 14:37:09 +0200
commit05ece4d167cf26c95ef58cc80e912dbd43d44c86 (patch)
tree78ae6de47c3b2e3ff390880e5ab614616898e37f /tun/wintun
parenttun: darwin: do not attempt to close tun.event twice (diff)
downloadwireguard-go-05ece4d167cf26c95ef58cc80e912dbd43d44c86.tar.xz
wireguard-go-05ece4d167cf26c95ef58cc80e912dbd43d44c86.zip
wintun: handle error for deadgwdetect
Diffstat (limited to 'tun/wintun')
-rw-r--r--tun/wintun/wintun_windows.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/tun/wintun/wintun_windows.go b/tun/wintun/wintun_windows.go
index 26ebf60..09bf14f 100644
--- a/tun/wintun/wintun_windows.go
+++ b/tun/wintun/wintun_windows.go
@@ -362,9 +362,10 @@ func CreateInterface(description string, requestedGUID *windows.GUID) (wintun *W
key, err = registry.OpenKey(registry.LOCAL_MACHINE, tcpipInterfaceRegKeyName, registry.SET_VALUE)
if err != nil {
err = fmt.Errorf("Error opening interface-specific TCP/IP network registry key: %v", err)
+ } else {
+ key.SetDWordValue("EnableDeadGWDetect", 0)
+ key.Close()
}
- key.SetDWordValue("EnableDeadGWDetect", 0)
- key.Close()
}
if err == nil {