ipn/ipnlocal: avoid ResetAndStop panic

Updates #18187

Change-Id: If7375efb7df0452a5e85b742fc4c4eecbbd62717
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2025-12-11 08:46:53 -08:00
committed by Brad Fitzpatrick
parent 6ace3995f0
commit 0df4631308

View File

@@ -5809,7 +5809,14 @@ func (b *LocalBackend) stateMachineLocked() {
func (b *LocalBackend) stopEngineAndWaitLocked() {
syncs.RequiresMutex(&b.mu)
b.logf("stopEngineAndWait...")
st, _ := b.e.ResetAndStop() // TODO: what should we do if this returns an error?
st, err := b.e.ResetAndStop()
if err != nil {
// TODO(braditz): our caller, popBrowserAuthNowLocked, probably
// should handle this somehow. For now, just log it.
// See tailscale/tailscale#18187
b.logf("stopEngineAndWait: ResetAndStop error: %v", err)
return
}
b.setWgengineStatusLocked(st)
b.logf("stopEngineAndWait: done.")
}