wintun: handle error for deadgwdetect

This commit is contained in:
Jason A. Donenfeld 2019-08-02 14:37:09 +02:00
parent 6d78f89557
commit 05ece4d167

View File

@ -362,10 +362,11 @@ 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()
}
}
if err == nil {
return wintun, rebootRequired, nil