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 <crawshaw@tailscale.com>
This commit is contained in:
David Crawshaw 2020-06-26 17:27:03 +10:00 committed by Brad Fitzpatrick
parent 23e74a0f7a
commit 9258d64261

View File

@ -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()
}