@ -60,7 +60,7 @@ func runNetcheck(ctx context.Context, args []string) error {
}
if strings . HasPrefix ( netcheckArgs . format , "json" ) {
fmt . Fprintln ( os. Stderr, "# Warning: this JSON format is not yet considered a stable interface" )
fmt . Fprintln ( Stderr, "# Warning: this JSON format is not yet considered a stable interface" )
}
dm , err := tailscale . CurrentDERPMap ( ctx )
@ -112,36 +112,36 @@ func printReport(dm *tailcfg.DERPMap, report *netcheck.Report) error {
}
if j != nil {
j = append ( j , '\n' )
os. Stdout. Write ( j )
Stdout. Write ( j )
return nil
}
fmt . P rintf( "\nReport:\n" )
fmt . P rintf( "\t* UDP: %v\n" , report . UDP )
p rintf( "\nReport:\n" )
p rintf( "\t* UDP: %v\n" , report . UDP )
if report . GlobalV4 != "" {
fmt . P rintf( "\t* IPv4: yes, %v\n" , report . GlobalV4 )
p rintf( "\t* IPv4: yes, %v\n" , report . GlobalV4 )
} else {
fmt . P rintf( "\t* IPv4: (no addr found)\n" )
p rintf( "\t* IPv4: (no addr found)\n" )
}
if report . GlobalV6 != "" {
fmt . P rintf( "\t* IPv6: yes, %v\n" , report . GlobalV6 )
p rintf( "\t* IPv6: yes, %v\n" , report . GlobalV6 )
} else if report . IPv6 {
fmt . P rintf( "\t* IPv6: (no addr found)\n" )
p rintf( "\t* IPv6: (no addr found)\n" )
} else {
fmt . P rintf( "\t* IPv6: no\n" )
p rintf( "\t* IPv6: no\n" )
}
fmt . P rintf( "\t* MappingVariesByDestIP: %v\n" , report . MappingVariesByDestIP )
fmt . P rintf( "\t* HairPinning: %v\n" , report . HairPinning )
fmt . P rintf( "\t* PortMapping: %v\n" , portMapping ( report ) )
p rintf( "\t* MappingVariesByDestIP: %v\n" , report . MappingVariesByDestIP )
p rintf( "\t* HairPinning: %v\n" , report . HairPinning )
p rintf( "\t* PortMapping: %v\n" , portMapping ( report ) )
// When DERP latency checking failed,
// magicsock will try to pick the DERP server that
// most of your other nodes are also using
if len ( report . RegionLatency ) == 0 {
fmt . P rintf( "\t* Nearest DERP: unknown (no response to latency probes)\n" )
p rintf( "\t* Nearest DERP: unknown (no response to latency probes)\n" )
} else {
fmt . P rintf( "\t* Nearest DERP: %v\n" , dm . Regions [ report . PreferredDERP ] . RegionName )
fmt . P rintf( "\t* DERP latency:\n" )
p rintf( "\t* Nearest DERP: %v\n" , dm . Regions [ report . PreferredDERP ] . RegionName )
p rintf( "\t* DERP latency:\n" )
var rids [ ] int
for rid := range dm . Regions {
rids = append ( rids , rid )
@ -168,7 +168,7 @@ func printReport(dm *tailcfg.DERPMap, report *netcheck.Report) error {
if netcheckArgs . verbose {
derpNum = fmt . Sprintf ( "derp%d, " , rid )
}
fmt . P rintf( "\t\t- %3s: %-7s (%s%s)\n" , r . RegionCode , latency , derpNum , r . RegionName )
p rintf( "\t\t- %3s: %-7s (%s%s)\n" , r . RegionCode , latency , derpNum , r . RegionName )
}
}
return nil