The -c and -w options failed both when -f (flood) was used and when a host was down (but no ICMP error packets were getting returned from routers) due to their logic checking placement in the for(;;) loop of the program. The "optcw" patch in the src.rpm fixes this. Also, -w was broken by checking time passed > time to run so it would always run 1 second longer than requested, and the "deadline" patch fixes this by changing it to >= Both the .src.rpm and .i386.rpm are available at http://sublogic.com/rpms/ with the above two patches and two simple %changelog entries for them, nothing else. -38 fixed the logic placement for the options but didn't catch the -w problem, -39 (available at the url) adds this fix. The -c option fix has been sent to the netkit-base maintainers against their 0.16 which doesn't include a -w option.
Fixed in iputils-991024-2 from Raw Hide. The optcw patch was already part of the sources, and I've added the deadline patch. Thanks for the patches.
*** Bug 6160 has been marked as a duplicate of this bug. ***
*** Bug 6254 has been marked as a duplicate of this bug. ****** Bug 6262 has been marked as a duplicate of this bug. ***
*** Bug 7785 has been marked as a duplicate of this bug. ***
*** Bug 7264 has been marked as a duplicate of this bug. ***
The updated netkit-base (netkit-base-0.10-39.i386.rpm) for Red Hat Linux 6.1 from "http://sublogic.com/rpms/" fixes the ping -c switch, but still it does not fix the exit status... the ping executable enclosed in the updated netkit-base always returns 0 whether the ping is successful or not (tested this for both the local network segment and an external site)... I have updated my iputils package from Red Hat's Rawhide ftp site to iputils-991024-4.i386.rpm only to find out that the -c switch is broken in that release! The above 2 'patches' fix one problem but not the other... so as far as I'm concerned, this is a catch-22 situation... is there a ping out there for RH 6.1 that actually works the way it should? If there is, please give specific URL location(s) for them... if there is a procedure or workaround, please state it in an unambiguous manner. I have read all the mozilla bug reports regarding ping (quite a few) and have read only generic statements from the developer(s) who are addressing this problem.
The package iputils-991024-5 (which contains ping) from Raw Hide ftp://rawhide.redhat.com fixes the problems described above as well as returning a valid exit code.
*** Bug 13211 has been marked as a duplicate of this bug. ***