cmd/tailscale: only refresh VPN tunnel if configuration changed

This used to work, but a later ChromeOS workaround closed and cleared the last
configuration before comparing it with the new.

Fixes tailscale/tailscale#966

Signed-off-by: Elias Naur <mail@eliasnaur.com>
pull/4/head
Elias Naur 4 years ago
parent 129abdb13f
commit 33a953fb21

@ -142,6 +142,10 @@ func (b *backend) setCfg(cfg *router.Config) error {
}
func (b *backend) updateTUN(service jni.Object, cfg *router.Config) error {
if reflect.DeepEqual(cfg, b.lastCfg) {
return nil
}
// Close previous tunnel(s).
// This is necessary for ChromeOS, native Android devices
// seem to handle seamless handover between tunnels correctly.
@ -150,9 +154,6 @@ func (b *backend) updateTUN(service jni.Object, cfg *router.Config) error {
// the closing on ChromeOS.
b.CloseTUNs()
if reflect.DeepEqual(cfg, b.lastCfg) {
return nil
}
if len(cfg.LocalAddrs) == 0 {
return nil
}

Loading…
Cancel
Save