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

Signed-off-by: Tom DNetto <tom@tailscale.com>
This commit is contained in:
Tom DNetto 2022-10-05 11:42:30 -07:00 committed by Tom
parent 7714261566
commit a37ee8483f

View File

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