mirror of
https://github.com/tailscale/tailscale.git
synced 2025-12-26 04:20:33 +00:00
cmd/tailscale/cli: fix panic in netcheck with mismatched DERP region IDs
Fixes #17564 Signed-off-by: Xinyu Kuo <gxylong@126.com>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
e1f0ad7a05
commit
8444659ed8
@@ -180,7 +180,11 @@ func printReport(dm *tailcfg.DERPMap, report *netcheck.Report) error {
|
||||
printf("\t* Nearest DERP: unknown (no response to latency probes)\n")
|
||||
} else {
|
||||
if report.PreferredDERP != 0 {
|
||||
printf("\t* Nearest DERP: %v\n", dm.Regions[report.PreferredDERP].RegionName)
|
||||
if region, ok := dm.Regions[report.PreferredDERP]; ok {
|
||||
printf("\t* Nearest DERP: %v\n", region.RegionName)
|
||||
} else {
|
||||
printf("\t* Nearest DERP: %v (region not found in map)\n", report.PreferredDERP)
|
||||
}
|
||||
} else {
|
||||
printf("\t* Nearest DERP: [none]\n")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user