mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-29 04:55:31 +00:00
wgengine: don't pass nil router.Config objects.
These are hard for swift to decode in the iOS app. Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
This commit is contained in:
parent
5114df415e
commit
f0b6ba78e8
@ -868,7 +868,7 @@ func (b *LocalBackend) enterState(newState State) {
|
||||
b.blockEngineUpdates(true)
|
||||
fallthrough
|
||||
case Stopped:
|
||||
err := b.e.Reconfig(&wgcfg.Config{}, nil)
|
||||
err := b.e.Reconfig(&wgcfg.Config{}, &router.Config{})
|
||||
if err != nil {
|
||||
b.logf("Reconfig(down): %v", err)
|
||||
}
|
||||
@ -958,7 +958,7 @@ func (b *LocalBackend) stateMachine() {
|
||||
// a status update that predates the "I've shut down" update.
|
||||
func (b *LocalBackend) stopEngineAndWait() {
|
||||
b.logf("stopEngineAndWait...")
|
||||
b.e.Reconfig(&wgcfg.Config{}, nil)
|
||||
b.e.Reconfig(&wgcfg.Config{}, &router.Config{})
|
||||
b.requestEngineStatusAndWait()
|
||||
b.logf("stopEngineAndWait: done.")
|
||||
}
|
||||
|
@ -11,6 +11,7 @@
|
||||
)
|
||||
|
||||
type darwinRouter struct {
|
||||
logf logger.Logf
|
||||
tunname string
|
||||
}
|
||||
|
||||
@ -19,7 +20,10 @@ func newUserspaceRouter(logf logger.Logf, _ *device.Device, tundev tun.Device) (
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &darwinRouter{tunname: tunname}, nil
|
||||
return &darwinRouter{
|
||||
logf: logf,
|
||||
tunname: tunname,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (r *darwinRouter) Up() error {
|
||||
|
@ -370,6 +370,10 @@ func configSignature(cfg *wgcfg.Config, routerCfg *router.Config) (string, error
|
||||
}
|
||||
|
||||
func (e *userspaceEngine) Reconfig(cfg *wgcfg.Config, routerCfg *router.Config) error {
|
||||
if routerCfg == nil {
|
||||
panic("routerCfg must not be nil")
|
||||
}
|
||||
|
||||
e.wgLock.Lock()
|
||||
defer e.wgLock.Unlock()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user