Whilst trying to make a script written for NetBSD run on FreeBSD, I discovered the script used a non-existant (on FreeBSD) ping option ``-o''. ping -o will exit after receiving a single reply packet, which is useful for trying to see if a host/link is alive at all (which is what the script was attempting to to do :). I checked cvsweb, and discovered the changes required to implement -o were pretty simple, so created the patch below, and decided it might be useful to the FreeBSD community. How-To-Repeat: N/A
David Taylor <davidt@yadt.co.uk> wrote: > ping -o will exit after receiving a single reply packet, which is useful > for trying to see if a host/link is alive at all (which is what the script > was attempting to to do :). Isn't this the same as `ping -c 1`?
On Sun, 26 May 2002, Dima Dorfman wrote: > David Taylor <davidt@yadt.co.uk> wrote: > > ping -o will exit after receiving a single reply packet, which is useful > > for trying to see if a host/link is alive at all (which is what the script > > was attempting to to do :). > > Isn't this the same as `ping -c 1`? No, ping -c 1 will exit after *sending* one packet, whether it is received or not. ping -o -c 10 will send (up to) 10 packets, exiting sucessfully after receiving the first reply, or exit(2)'ing if it fails to receive a reply from any packet. -- David Taylor davidt@yadt.co.uk "The future just ain't what it used to be"
State Changed From-To: open->closed Committed to -current, thanks! I'll MFC this after 4.7.