Skip to content

Commit 02768ec

Browse files
committed
libtailscale: do not close old TUNs during reconfig on ChromeOS
The bug that required us to close previous tunnels during VPN reconfiguration on ChromeOS in 8dbac87 was resolved sometime between June 2020 and February 2021. While we do not know exactly when it was fixed, we believe the issue was resolved in November 2020, when OpenVpnDriver was migrated to the VpnService state machine: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/2497361 While I couldn't find a reliable way to determine which ChromeOS version we're running on, the Auto Update Expiration (AUE) policy suggests that only devices manufactured in 2017 or earlier might not be eligible for an update to a version with the seamless handover fix. Considering the above, in this commit we stop closing old TUNs on ChromeOS to avoid breaking connections for users running newer (November 2020+) ChromeOS releases. Updates tailscale/tailscale#19591 Signed-off-by: Nick Khyl <nickk@tailscale.com>
1 parent dca6313 commit 02768ec

1 file changed

Lines changed: 4 additions & 19 deletions

File tree

libtailscale/net.go

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,7 @@ func (b *backend) updateTUN(rcfg *router.Config, dcfg *dns.OSConfig) (err error)
8080
b.logger.Logf("updateTUN: changed")
8181
defer b.logger.Logf("updateTUN: finished")
8282

83-
hasTunnel := false
84-
disableTUN := len(rcfg.LocalAddrs) == 0
85-
isChromeOS, _ := b.appCtx.IsChromeOS()
86-
if disableTUN || isChromeOS {
87-
// Close previous tunnel(s).
88-
// This is necessary for ChromeOS, native Android devices
89-
// seem to handle seamless handover between tunnels correctly.
90-
//
91-
// TODO(eliasnaur): If seamless handover becomes a desirable feature, skip
92-
// the closing on ChromeOS.
83+
if disableTUN := len(rcfg.LocalAddrs) == 0; disableTUN {
9384
b.logger.Logf("updateTUN: closing old TUNs")
9485
b.CloseTUNs()
9586
b.logger.Logf("updateTUN: closed old TUNs")
@@ -104,14 +95,9 @@ func (b *backend) updateTUN(rcfg *router.Config, dcfg *dns.OSConfig) (err error)
10495
// successfully. See tailscale/tailscale#18679.
10596
//
10697
// TODO(nickkhyl): revisit and simplify the [multiTUN] implementation?
107-
defer func() {
108-
if !hasTunnel && b.devices.Down() {
109-
b.logger.Logf("updateTUN: tunnel brought down: %v", err)
110-
}
111-
}()
112-
}
113-
114-
if disableTUN {
98+
if b.devices.Down() {
99+
b.logger.Logf("updateTUN: tunnel brought down: %v", err)
100+
}
115101
return nil
116102
}
117103

@@ -249,7 +235,6 @@ func (b *backend) updateTUN(rcfg *router.Config, dcfg *dns.OSConfig) (err error)
249235
b.logger.Logf("updateTUN: created TUN device")
250236

251237
b.devices.add(tunDev)
252-
hasTunnel = true
253238
b.logger.Logf("updateTUN: added TUN device")
254239

255240
if b.devices.Up() {

0 commit comments

Comments
 (0)