wgengine/router: report to control when setPrivateNetwork fails

Fixes #1503

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2021-03-15 15:39:37 -07:00
committed by Brad Fitzpatrick
parent ba8c6d0775
commit 232cfda280
3 changed files with 11 additions and 0 deletions

View File

@@ -56,6 +56,12 @@ func SetRouterHealth(err error) { set("router", err) }
// RouterHealth returns the wgengine/router.Router error state.
func RouterHealth() error { return get("router") }
// SetNetworkCategoryHealth sets the state of setting the network adaptor's category.
// This only applies on Windows.
func SetNetworkCategoryHealth(err error) { set("network-category", err) }
func NetworkCategoryHealth() error { return get("network-category") }
func get(key string) error {
mu.Lock()
defer mu.Unlock()