cmd/tailscale: make netcheck work when logged out

Fixes #2993

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick 2021-10-04 11:42:51 -07:00
parent 58e1475ec7
commit 2d464cecd1

View File

@ -64,7 +64,11 @@ func runNetcheck(ctx context.Context, args []string) error {
}
dm, err := tailscale.CurrentDERPMap(ctx)
if err != nil {
noRegions := dm != nil && len(dm.Regions) == 0
if noRegions {
log.Printf("No DERP map from tailscaled; using default.")
}
if err != nil || noRegions {
dm, err = prodDERPMap(ctx, http.DefaultClient)
if err != nil {
return err