control/controlclient: avoid crash sending map request with zero node key

Fixes #1271

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
(cherry picked from commit 7529b74018)
This commit is contained in:
Brad Fitzpatrick 2021-02-04 16:23:16 -08:00
parent c027962893
commit 910682c851

View File

@ -550,6 +550,9 @@ func (c *Direct) sendMapRequest(ctx context.Context, maxPolls int, cb func(*Netw
everEndpoints := c.everEndpoints everEndpoints := c.everEndpoints
c.mu.Unlock() c.mu.Unlock()
if persist.PrivateNodeKey.IsZero() {
return errors.New("privateNodeKey is zero")
}
if backendLogID == "" { if backendLogID == "" {
return errors.New("hostinfo: BackendLogID missing") return errors.New("hostinfo: BackendLogID missing")
} }