summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAvery Pennarun <apenwarr@tailscale.com>2021-05-20 03:10:55 -0400
committerAvery Pennarun <apenwarr@tailscale.com>2021-05-20 03:35:14 -0400
commitf308995edfe7c5a1e8f2ec9b310b033a5f900db8 (patch)
tree691fb36b73c2ddb38fab46120fa87e79247b4ce7
parentee19c530638f9737eae960b42c4849e87f7f1cd1 (diff)
downloadtailscale-apenwarr/check184.tar.xz
tailscale-apenwarr/check184.zip
ipnlocal: in Start() fast path, don't forget to send Prefs.apenwarr/check184
The resulting empty Prefs had AllowSingleHosts=false and Routeall=false, so that on iOS if you did these steps: - Login and leave running - Terminate the frontend - Restart the frontend (fast path restart, missing prefs) - Set WantRunning=false - Set WantRunning=true ...then you would have Tailscale running, but with no routes. You would also accidentally disable the ExitNodeID/IP prefs (symptom: the current exit node setting didn't appear in the UI), but since nothing else worked either, you probably didn't notice. The fix was easy enough. It turns out we already knew about the problem, so this also fixes one of the BUG entries in state_test. Fixes: #1918 (BUG-1) and some as-yet-unreported bugs with exit nodes. Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
-rw-r--r--ipn/ipnlocal/local.go1
-rw-r--r--ipn/ipnlocal/state_test.go5
2 files changed, 2 insertions, 4 deletions
diff --git a/ipn/ipnlocal/local.go b/ipn/ipnlocal/local.go
index 877978729..3000eb8e0 100644
--- a/ipn/ipnlocal/local.go
+++ b/ipn/ipnlocal/local.go
@@ -714,6 +714,7 @@ func (b *LocalBackend) Start(opts ipn.Options) error {
b.send(ipn.Notify{
State: &state,
NetMap: nm,
+ Prefs: b.prefs,
LoginFinished: new(empty.Message),
})
return nil
diff --git a/ipn/ipnlocal/state_test.go b/ipn/ipnlocal/state_test.go
index 0630eb6e9..7fef0c166 100644
--- a/ipn/ipnlocal/state_test.go
+++ b/ipn/ipnlocal/state_test.go
@@ -550,10 +550,7 @@ func TestStateMachine(t *testing.T) {
c.Assert(nn[0].State, qt.Not(qt.IsNil))
c.Assert(nn[0].LoginFinished, qt.Not(qt.IsNil))
c.Assert(nn[0].NetMap, qt.Not(qt.IsNil))
- // BUG: Prefs should be sent too, or the UI could end up in
- // a bad state. (iOS, the only current user of this feature,
- // probably wouldn't notice because it happens to not display
- // any prefs. Maybe exit nodes will look weird?)
+ c.Assert(nn[0].Prefs, qt.Not(qt.IsNil))
}
// undo the state hack above.