From 9258d64261b5c90ab8fad5b9bbc87b046fb3fe0f Mon Sep 17 00:00:00 2001 From: David Crawshaw Date: Fri, 26 Jun 2020 17:27:03 +1000 Subject: [PATCH] wgengine/router: do not call ifconfig up if SetRoutesFunc is set The NetworkExtension brings up the interface itself and does not have access to `ifconfig`, which the underlying BSD userspace router attempts to use when Up is called. Signed-off-by: David Crawshaw --- wgengine/router/router_darwin.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wgengine/router/router_darwin.go b/wgengine/router/router_darwin.go index 5e9cb14a1..7dab1cf91 100644 --- a/wgengine/router/router_darwin.go +++ b/wgengine/router/router_darwin.go @@ -45,3 +45,10 @@ func (r *darwinRouter) Set(cfg *Config) error { return r.Router.Set(cfg) } + +func (r *darwinRouter) Up() error { + if SetRoutesFunc != nil { + return nil // bringing up the tunnel is handled externally + } + return r.Router.Up() +}