Describe the bug
gping fails to ping IPv6 addresses on systems using modern iputils, because it tries to execute a separate ping6 binary which no longer exists.
This results in:
Error: Error spawning ping: No such file or directory (os error 2)
Even when a capable dual-stack ping from iputils is in $PATH (successfully probed via ping -V), gping does not fall back to using ping -6.
To Reproduce
gping 2620:fe::fe
# or
gping -6 2620:fe::fe
Strace shows:
- Successful
ping -V probe (detects iputils)
- Then attempts
.../bin/ping6 → ENOENT
- Searches other locations for
ping6 → all fail
- Exits with os error 2
Expected behavior
gping should use ping -6 for IPv6 targets when a modern dual-stack ping (iputils) is available, or fall back to it if ping6 is not found.
Additional context
Suggested fix
Update the pinger logic to:
- Try
ping6 if it exists (legacy support)
- Otherwise use
ping -6 when iputils is detected
Thanks for the great tool! This small change would make IPv6 work out-of-the-box on current Linux systems with iputils.
Describe the bug
gpingfails to ping IPv6 addresses on systems using modern iputils, because it tries to execute a separateping6binary which no longer exists.This results in:
Even when a capable dual-stack
pingfrom iputils is in$PATH(successfully probed viaping -V),gpingdoes not fall back to usingping -6.To Reproduce
gping 2620:fe::fe # or gping -6 2620:fe::feStrace shows:
ping -Vprobe (detects iputils).../bin/ping6→ ENOENTping6→ all failExpected behavior
gpingshould useping -6for IPv6 targets when a modern dual-stackping(iputils) is available, or fall back to it ifping6is not found.Additional context
ping6binary in 2015 (version s20150815):doc: ping: add missing options and remove ping6 iputils/iputils#31
Quote: "As of version s20150815, the ping6 binary doesn't exist anymore."
gpingalready requires iputils (rejects inetutils/BusyBox)ping -6, which would fix this.Suggested fix
Update the pinger logic to:
ping6if it exists (legacy support)ping -6when iputils is detectedThanks for the great tool! This small change would make IPv6 work out-of-the-box on current Linux systems with iputils.