ipn/ipnlocal: fix data race from missing lock in NetworkLockStatus

Signed-off-by: Tom DNetto <tom@tailscale.com>
pull/5852/head
Tom DNetto 2 years ago committed by Tom
parent 7714261566
commit a37ee8483f

@ -294,6 +294,9 @@ func (b *LocalBackend) CanSupportNetworkLock() error {
// NetworkLockStatus returns a structure describing the state of the // NetworkLockStatus returns a structure describing the state of the
// tailnet key authority, if any. // tailnet key authority, if any.
func (b *LocalBackend) NetworkLockStatus() *ipnstate.NetworkLockStatus { func (b *LocalBackend) NetworkLockStatus() *ipnstate.NetworkLockStatus {
b.mu.Lock()
defer b.mu.Unlock()
if b.tka == nil { if b.tka == nil {
return &ipnstate.NetworkLockStatus{ return &ipnstate.NetworkLockStatus{
Enabled: false, Enabled: false,

Loading…
Cancel
Save