ipn/ipnlocal: network-lock, error if no pubkey instead of panic

Updates tailscale/corp#20931

Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
Kristoffer Dalby 2024-06-17 16:11:50 +02:00 committed by Kristoffer Dalby
parent 9d2b1820f1
commit 01aa01f310

View File

@ -255,7 +255,10 @@ func (b *LocalBackend) tkaSyncIfNeeded(nm *netmap.NetworkMap, prefs ipn.PrefsVie
b.logf("tkaSyncIfNeeded: enabled=%v, head=%v", nm.TKAEnabled, nm.TKAHead)
}
ourNodeKey := prefs.Persist().PublicNodeKey()
ourNodeKey, ok := prefs.Persist().PublicNodeKeyOK()
if !ok {
return errors.New("tkaSyncIfNeeded: no node key in prefs")
}
isEnabled := b.tka != nil
wantEnabled := nm.TKAEnabled