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 <[email protected]>
This commit is contained in:
David Crawshaw authored and Brad Fitzpatrick committed 2020-06-26 09:45:28 -07:00
1 parent 23e74a0f7a
commit 9258d64261
1 file changed
+7
+7
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()
}