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