mirror of
https://github.com/tailscale/tailscale.git
synced 2025-12-24 17:47:30 +00:00
ipn/ipnlocal: fix data race on captiveCtx in enterStateLockedOnEntry (#17495)
Updates #17491 Signed-off-by: James Sanderson <jsanderson@tailscale.com>
This commit is contained in:
committed by
GitHub
parent
0586d5d40d
commit
2d1014ead1
@@ -5573,8 +5573,9 @@ func (b *LocalBackend) enterStateLockedOnEntry(newState ipn.State, unlock unlock
|
||||
// can be shut down if we transition away from Running.
|
||||
if buildfeatures.HasCaptivePortal {
|
||||
if b.captiveCancel == nil {
|
||||
b.captiveCtx, b.captiveCancel = context.WithCancel(b.ctx)
|
||||
b.goTracker.Go(func() { hookCheckCaptivePortalLoop.Get()(b, b.captiveCtx) })
|
||||
captiveCtx, captiveCancel := context.WithCancel(b.ctx)
|
||||
b.captiveCtx, b.captiveCancel = captiveCtx, captiveCancel
|
||||
b.goTracker.Go(func() { hookCheckCaptivePortalLoop.Get()(b, captiveCtx) })
|
||||
}
|
||||
}
|
||||
} else if oldState == ipn.Running {
|
||||
|
||||
Reference in New Issue
Block a user