cmd/tailscale: reset cached config when failing to set up VPN tunnel

Add a bit of logging while here.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
pull/3/head
Elias Naur 4 years ago
parent b297135f2a
commit 31b3c725c8

@ -235,7 +235,7 @@ func (b *backend) updateTUN(service jni.Object, cfg *router.Config) error {
return nil
})
if err != nil {
b.lastCfg = cfg
b.lastCfg = nil
b.CloseTUNs()
return err
}

@ -193,6 +193,7 @@ func (a *App) runBackend() error {
if service != 0 {
if cfg != nil && state.State >= ipn.Starting {
if err := b.updateTUN(service, cfg); err != nil {
log.Printf("VPN update failed: %v", err)
a.notifyVPNClosed()
}
} else {
@ -253,6 +254,7 @@ func (a *App) runBackend() error {
}
if cfg != nil && state.State >= ipn.Starting {
if err := b.updateTUN(service, cfg); err != nil {
log.Printf("VPN update failed: %v", err)
a.notifyVPNClosed()
}
}

Loading…
Cancel
Save