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.
|
// can be shut down if we transition away from Running.
|
||||||
if buildfeatures.HasCaptivePortal {
|
if buildfeatures.HasCaptivePortal {
|
||||||
if b.captiveCancel == nil {
|
if b.captiveCancel == nil {
|
||||||
b.captiveCtx, b.captiveCancel = context.WithCancel(b.ctx)
|
captiveCtx, captiveCancel := context.WithCancel(b.ctx)
|
||||||
b.goTracker.Go(func() { hookCheckCaptivePortalLoop.Get()(b, b.captiveCtx) })
|
b.captiveCtx, b.captiveCancel = captiveCtx, captiveCancel
|
||||||
|
b.goTracker.Go(func() { hookCheckCaptivePortalLoop.Get()(b, captiveCtx) })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if oldState == ipn.Running {
|
} else if oldState == ipn.Running {
|
||||||
|
|||||||
Reference in New Issue
Block a user