mirror of
https://github.com/tailscale/tailscale.git
synced 2025-02-19 19:38:40 +00:00
wgengine/netstack: fake pings through netstack on Android too
Every OS ping binary is slightly different. Adjust for Android's. Updates #1738 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
138662e248
commit
1a4e8da084
@ -419,6 +419,12 @@ func (ns *Impl) userPing(dstIP netaddr.IP, pingResPkt []byte) {
|
|||||||
switch runtime.GOOS {
|
switch runtime.GOOS {
|
||||||
case "windows":
|
case "windows":
|
||||||
err = exec.Command("ping", "-n", "1", "-w", "3000", dstIP.String()).Run()
|
err = exec.Command("ping", "-n", "1", "-w", "3000", dstIP.String()).Run()
|
||||||
|
case "android":
|
||||||
|
ping := "/system/bin/ping"
|
||||||
|
if dstIP.Is6() {
|
||||||
|
ping = "/system/bin/ping6"
|
||||||
|
}
|
||||||
|
err = exec.Command(ping, "-c", "1", "-w", "3", dstIP.String()).Run()
|
||||||
default:
|
default:
|
||||||
err = exec.Command("ping", "-c", "1", "-W", "3", dstIP.String()).Run()
|
err = exec.Command("ping", "-c", "1", "-W", "3", dstIP.String()).Run()
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user