From: Jason A. Donenfeld Date: Fri, 2 Aug 2019 12:37:09 +0000 (+0200) Subject: wintun: handle error for deadgwdetect X-Git-Tag: 0.0.20190805~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=05ece4d167cf26c95ef58cc80e912dbd43d44c86;p=thirdparty%2Fwireguard-go.git wintun: handle error for deadgwdetect --- 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 {