History log of /freebsd-10.0-release/sbin/ping/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
259065 07-Dec-2013 gjb

- Copy stable/10 (r259064) to releng/10.0 as part of the
10.0-RELEASE cycle.
- Update __FreeBSD_version [1]
- Set branch name to -RC1

[1] 10.0-CURRENT __FreeBSD_version value ended at '55', so
start releng/10.0 at '100' so the branch is started with
a value ending in zero.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


241852 22-Oct-2012 eadler

Check the return error of set[ug]id. While this can never fail in the
current version of FreeBSD, this isn't guarenteed by the API. Custom
security modules, or future implementations of the setuid and setgid
may fail.

PR: bin/172289
PR: bin/172290
PR: bin/172291
Submittud by: Erik Cederstrand <erik@cederstrand.dk>
Discussed by: freebsd-security
Approved by: cperciva
MFC after: 1 week


237942 02-Jul-2012 delphij

Use timeclear() instead of home grown version.

MFC after: 2 weeks


209366 20-Jun-2010 ed

Small style fixes:

- ANSIfy prototypes.
- Remove unneeded whitespace.
- Add const keyword to function where it can be used.


187067 11-Jan-2009 danger

- improve readability

Reviewed by: trhodes, keramida
MFC after: 3 days


186843 07-Jan-2009 danger

- rename the RETURN VALUES section to EXIT STATUS
- not bumping a date as this is not a real content change

Approved by: ru
MFC after: 3 days


171135 01-Jul-2007 gnn

Commit IPv6 support for FAST_IPSEC to the tree.
This commit includes all remaining changes for the time being including
user space updates.

Submitted by: bz
Approved by: re


169833 21-May-2007 cognet

Force the alignment of the chars arrays, as they are casted later to
structs.
gcc 4.2 doesn't do it by default, and that results in unaligned access on
arm.


161526 22-Aug-2006 ru

Remove alpha left-overs.


161273 14-Aug-2006 dd

Print packet loss figures with one decimal place. ping6 already does
this, and OpenBSD and NetBSD pings do it too. This is primarily useful
for comparing low levels of packet loss.


157535 05-Apr-2006 glebius

Add a new feature to ping(8) - possibility to specify maximum
wait time for a packet. This allows to:

- Count number of packets received before and after specified
time.
- Shorten time of execution of 'ping -c 1' scripts.

Submitted by: Lytochkin Boris <lytboris gmail.com>


152996 01-Dec-2005 ru

Sync usage() with SYNOPSIS.


152568 18-Nov-2005 ru

-mdoc sweep.


149086 15-Aug-2005 glebius

Implement a new feature for ping(8) - sweeping pings. In a sweeping
ping ICMP payload of packets being sent is increased with given step.
Sweeping pings are useful for testing problematic channels, MTU
issues or traffic policing functions in networks.

PR: bin/82625
Submitted by: Chris Hellberg <chellberg juniper.net> (with some cleanups)


135957 30-Sep-2004 maxim

o Store timestamp in network byte order.
o Remove an assumption sizeof(struct timeval) == 8 (this is not
true on sparc64).

Reviewed by: imp, -hackers
Obtained from: NetBSD (rev. 1.75)
MT5 after: 1 month


133723 14-Aug-2004 stefanf

Avoid using void pointers in additive expressions.

PR: 56653


128073 09-Apr-2004 markm

Remove advertising clause from University of California Regent's license,
per letter dated July 22, 1999.

Approved by: core, imp


128015 07-Apr-2004 iedowse

Don't turn off the regular SIGINFO status information. The use of
the NOKERNINFO flag only marginally de-clutters the output and
has a number of unwanted side effects:
o The kernel info might be what you want to see
o ^T is left non-functional if ping is killed non-cleanly
o "ping -q foo &" gets suspended on tty output

Encouraged by: bde


126178 23-Feb-2004 johan

style.Makefile(5):
Use WARNS?= instead of WARNS=.


125605 08-Feb-2004 iedowse

Certain ICMP error replies cause ping to perform a reverse DNS
lookup on an IP address from the packet (such as the IP that sent
a TTL exceeded error). If the DNS lookup takes a long time, ^C will
appear to be ineffective since the SIGINT handler just sets a flag
and returns. Work around this by exiting immediately on receipt of
a second SIGINT when DNS lookups are enabled.

PR: bin/4696
MFC after: 1 week


119893 08-Sep-2003 ru

mdoc(7): Use the new feature of the .In macro.


117550 14-Jul-2003 maxim

o Rename local variables, do not shadow global declarations.


117549 14-Jul-2003 maxim

o Kill MINICMPLEN, there is ICMP_MINLEN already.


117548 14-Jul-2003 maxim

o Be ready to get a reply with length up to IP_MAXPACKET.
o Warn when recieved packet length is not equal to length of the
packet we sent out. Idea from NetBSD.
o Fit the dump of packet with wrong data to 80 columns (from NetBSD).

Comments from: bde


116806 25-Jun-2003 ru

The current recommended default time to live (TTL) for the Internet
Protocol (IP) is 64 [RFC791, RFC1122].

Prodded by: Igor Kucherenko <kivvy@sunbay.com>
Obtained from: http://www.iana.org/assignments/ip-parameters


115691 02-Jun-2003 maxim

Fix SIGINFO handling: do not print incorrect timing statistics
when the data for it is not available.

Founded by: ping -s0 localhost; press ^T


114589 03-May-2003 obrien

Use __FBSDID() to quiet GCC 3.3 warnings.


113463 14-Apr-2003 maxim

o Skip timestamp part when checking payload.

PR: bin/50909
Submitted by: Barney Wolff <barney@lab.databus.com>


113217 07-Apr-2003 mdodd

Deal with a case where the returned packed was smaller than the
transmitted packet (because the remote host stripped off our icmp_data).

Submitted by: Maxim Konovalov <maxim@macomnet.ru>


112985 02-Apr-2003 mdodd

Back out support for RFC3514.

RFC3514 poses an unacceptale risk to compliant systems.


112980 02-Apr-2003 maxim

IP_EVIL -> IP_EF


112929 01-Apr-2003 mdodd

Implement support for RFC 3514 (The Security Flag in the IPv4 Header).
(See: ftp://ftp.rfc-editor.org/in-notes/rfc3514.txt)

This fulfills the host requirements for userland support by
way of the setsockopt() IP_EVIL_INTENT message.

There are three sysctl tunables provided to govern system behavior.

net.inet.ip.rfc3514:

Enables support for rfc3514. As this is an
Informational RFC and support is not yet widespread
this option is disabled by default.

net.inet.ip.hear_no_evil

If set the host will discard all received evil packets.

net.inet.ip.speak_no_evil

If set the host will discard all transmitted evil packets.

The IP statistics counter 'ips_evil' (available via 'netstat') provides
information on the number of 'evil' packets recieved.

For reference, the '-E' option to 'ping' has been provided to demonstrate
and test the implementation.


112729 28-Mar-2003 mdodd

Default data length should be 56, not 64.


112568 24-Mar-2003 mdodd

- Make -M mask and -M time exclusive.
- Correct some problems with packet construction.

+--------+------------+----------+-------------+---------+
| | | | | |
| IP Hdr | MINICMPLEN | phdr_len | TIMEVAL_LEN | payload |
| | | | | |
+--------+------------+----------+-------------+---------+
| | | |
|<- IP ->|<------- ICMP -------->|<------ datalen ------>|

My previous changes tried to mess around with 'datalen' instead of
modifying 'phdr_len'.

I'm including this nice ASCII diagram (from Maxim) to further clarify things
in CVS history.

Submitted by: Maxim Konovalov <maxim@macomnet.ru>


112531 24-Mar-2003 bde

Fixed an errx format error in rev.1.81. This should have been fatal
when WARNS was increased recently, but __printf0like() has been
temporarily disabled for 8 months.

Fixed related style bugs (disordered declaraction and silly type for
maxpayload -- assume 16-bit ints like the rest of ping.c).


112228 14-Mar-2003 ru

Demangle the usage message at the source level.

Submitted by: bde


112110 11-Mar-2003 ru

Fix and sync SYNOPSIS and usage().

Prodded by: bde


111932 05-Mar-2003 seanc

Update ping to be WARNS=2 compliant.

Reviewed by: -audit (no objections ~1mo)
Approved by: nectar


111930 05-Mar-2003 mdodd

Spelling, grammar fixes.


111927 05-Mar-2003 mdodd

Remove documentation of old '-M' flag.
Re-order.


111765 02-Mar-2003 mdodd

Support ICMP_TSTAMP/ICMP_TSTAMPREPLY.

This alters the meaning of the '-M' flag.


111287 23-Feb-2003 ru

Sort options.


110054 29-Jan-2003 mdodd

Call fill() after maxpayload has been initialized.

Reviewed by: maxim


110009 28-Jan-2003 mdodd

Send ICMP_MASKREQ packets when the '-M' option is specified.


109734 23-Jan-2003 maxim

Better error handling for -s.

Submitted by: bde

Do not constantify maximum payload size. It is 65467 with -R
(record route), and 65507 without it.

Reviewed by: silence on -net
Proposed by: bde

I am going to MFC rev.1.77 - 1.81 ping.c and rev.1.39 and 1.40 ping.8:

MFC after: 6 months


109733 23-Jan-2003 maxim

style(9) sweep.

Submitted by: bde


109732 23-Jan-2003 maxim

Anti-magic: s/255/MAXTTL/


109731 23-Jan-2003 maxim

Implement -D (do not fragment) and -z (TOS) options.

PR: bin/29164
Reviewed by: silence of -net
Obtained from: OpenBSD


109730 23-Jan-2003 maxim

Print strict source routing option.

Reviewed by: silence on -net
Proposed by: David Wang <dsw@juniper.net>


108317 27-Dec-2002 schweikh

english(4) police.


108260 24-Dec-2002 ru

Spelling: s/then/than/ where appropriate.


105624 21-Oct-2002 maxim

Fix LSRR option length check: it has to be less or equal remained header's
length minus sizeof(struct ip).

MFC after: 1 week


104339 02-Oct-2002 dd

Add an -o option to exit after receiving one reply. This can be used
to test whether a link is live.

PR: 38573
Submitted by: David Taylor <davidt@yadt.co.uk>
Obtained from: NetBSD


103229 11-Sep-2002 peter

Commit "unrelated style fixes" part of Bruce's patch (regarding
bcopy/memcpy) seperately.

Submitted by: bde


103227 11-Sep-2002 peter

Modify previous commit to solve the real problem that made gcc think
the timestamp was aligned. ie: Use a void * instead of struct timeval *
which gcc assumes will be aligned. Go back to memcpy().

Submitted by: bde


103146 09-Sep-2002 nectar

In reference to previous commit: use err(3).

Noticed by: bde


103129 09-Sep-2002 nectar

Check for FD_SET overrun.


102471 27-Aug-2002 iedowse

Add the -A flag to the usage line.

Submitted by: Yutaka KAWASE <yutaka@mailhost.net>
MFC after: 3 days


101623 10-Aug-2002 peter

Fix the broken "avoid unaligned data" fix. The problem is that the builtin
gcc memcpy "knows" about types that are supposed to be actually already
aligned and triggers alignment errors doing the memcpy itself.
"Fix" this by changing it to a bcopy(). In this case, we had:
struct timeval *tp;
struct timeval tv1;
memcpy(&tv1,tp,sizeof(tv1));
.. and since gcc *knows* that a pointer to a timeval is longword aligned
and that tv1 is longword aligned, then it can use an inline that assumes
alignment. The following works too:
cp = (char *)tp;
memcpy(&tv1,cp,sizeof(tv1));
Simply casting (char *)tp for the memcpy doesn't work. :-(
This affected different 64 bit platforms in different ways and depends
a lot on gcc as well. I've seen this on alpha and ia64 at least, although
alpha isn't doing it right now.


99501 06-Jul-2002 charnier

The .Nm utility


99447 05-Jul-2002 maxim

o Change almost all magic numbers to the appropriate constants.
o Fix zero payloading, unbreak ping -s 0.
o Increase socket recieve buffer, ping -s 65467 is working now.

Submitted by: anti-magic sweep based on kris's patch
Reviewed by: bde, silence on -audit
MFC after: 2 months


99446 05-Jul-2002 maxim

More strict ip options parsing.

Reviewed by: bde (style), silence on -audit
MFC after: 2 months


93643 02-Apr-2002 maxim

WARNS fixes.

Submitted by: kris
Reviewed by: bde
Approved by: ru
MFC after: 2 weeks


93638 02-Apr-2002 maxim

style(9) cleanup.

Submitted by: kris (an early version of this patch)
Reviewed by: bde
Approved by: ru
MFC after: 2 weeks


93035 23-Mar-2002 obrien

Style(9) local vars after 'register' removal.

Requested by: bde


92806 20-Mar-2002 obrien

Remove 'register' keyword.
It does not help modern compilers, and some may take some hit from it.
(I also found several functions that listed *every* of its 10 local vars with
"register" -- just how many free registers do people think machines have?)


91432 27-Feb-2002 fenner

Use network byte order for the ICMP sequence number. This is only
significant when monitoring packets on another system, since
otherwise the ICMP sequence number is only used by the ping client.


90351 07-Feb-2002 maxim

Document ping(8) reaction to SIGINFO.

PR: doc/33639
Reviewed by: ru
Approved by: ru
MFC after: 1 week


89349 14-Jan-2002 ru

Fixed two bugs with the "-l preload" option:

- first ping after a preload was sent undelayed
- we could send more than -c packets in preload

PR: bin/32354


87325 04-Dec-2001 obrien

Default to WARNS=2.
Binary builds that cannot handle this must explicitly set WARNS=0.

Reviewed by: mike


83940 25-Sep-2001 iedowse

The -A option (beep when packets are dropped) didn't work quite
right; after a single packet was dropped it beeped after every
transmission.

Change its implementation to only output a bell when there is an
increase in the maximum value of the number of packets that were
sent but not yet received. This has the benefit that even for very
long round-trip times, ping -A will do roughly the right thing
after a few inital false-positives.

Reviewed by: ru


83391 13-Sep-2001 ru

Set BINOWN=root explicitly for setuid root binaries.

This is not "useless", as one may have non-default
setting for BINOWN in make.conf, and we still want
these to be installed setuid root in this case.


83112 05-Sep-2001 dd

Use CFLAGS, not COPTS, in the Makefile. bsd.prog.mk conveniently adds
COPTS towards the end of final CFLAGS so that it can be used to
override Makefile and other defaults. Using it in Makefiles risks
having options set using it clobbered when somebody uses it on the
command line.

Approved by: bde


81251 07-Aug-2001 ru

mdoc(7) police:

Avoid using parenthesis enclosure macros (.Pq and .Po/.Pc) with plain text.
Not only this slows down the mdoc(7) processing significantly, but it also
has an undesired (in this case) effect of disabling hyphenation within the
entire enclosed block.


79754 15-Jul-2001 dd

Remove whitespace at EOL.


79530 10-Jul-2001 ru

mdoc(7) police: removed HISTORY info from the .Os call.


79403 07-Jul-2001 mjacob

Ian Dowse writes:

The original code was certainly broken; it knows that whereto is
to be used for a sockaddr_in, so it should be declared as such.
To support multiple protocols, there is also a sockaddr_storage
struct that can be used; I don't think struct sockaddr is supposed
to be used anywhere other than for casts and pointers.

Submitted by: Ian Dowse <iedowse@maths.tcd.ie>
MFC after: 3 weeks


79381 07-Jul-2001 mjacob

Fix unaligned access faults on alpha.

This one is strange and goes against my rusty compiler knowledge.

The global declaration

struct sockaddr whereto;

produces for both i386 && alpha:

.comm whereto,16,1

which means common storage, byte aligned. Ahem. I though structs
were supposed to be ALDOUBLE always? I mean, w/o pragma packed?

Later on, this address is coerced to:

to = (struct sockaddr_in *)&whereto;

Up until now, we've been fine on alpha because the address
just ended up aligned to a 4 byte boundary. Lately, though,
it end up as:

0000000120027b0f B whereto

And, tra la, you get unaligned access faults. The solution I picked, in
lieu of understanding what the compiler was doing, is to put whereto
as a union of a sockaddr and sockaddr_in. That's more formally correct
if somewhat awkward looking.


79018 30-Jun-2001 rwatson

Modify ping so that it increases the send socket buffer size if the
user runs with privilege, allowing the sending of icmp packets with
larger size (up to 48k, the default receive buffer size in ping),
which is useful for network driver development testing, as well
as experimentation with fragmentation.

Reviewed by: wpaul


77119 24-May-2001 phk

Add a -A option to ping which beeps when packets are lost.

PR: 11818
Submitted by: Marc Evans marc@destek.net


74815 26-Mar-2001 ru

- Backout botched attempt to introduce MANSECT feature.
- MAN[1-9] -> MAN.


74531 20-Mar-2001 ru

Set the default manual section for sbin/ to 8.


74029 09-Mar-2001 ru

Add new option -m which allows the user to set IP TTL.


70152 18-Dec-2000 ru

Prepare for mdoc(7)NG.


68960 20-Nov-2000 ru

mdoc(7) police: use the new features of the Nm macro.


68905 19-Nov-2000 kris

Format string paranoia


58068 14-Mar-2000 shin

Use CMSG_LEN() to compute ping SCM_TIMESTAMP cmsg_len.
Without this, cmsg_len size should be smaller than necessary on alpha.
(Though, no obvious error was seen on ping time value on beast.)


57719 03-Mar-2000 shin

CMSG_XXX macros alignment fixes to follow RFC2292.

Approved by: jkh

Submitted by: Partly from tech@openbsd
Reviewed by: itojun


57668 01-Mar-2000 sheldonh

Remove single-space hard sentence breaks. These degrade the quality
of the typeset output, tend to make diffs harder to read and provide
bad examples for new-comers to mdoc.


57032 08-Feb-2000 shin

ping -S option was missing from IPsec merge, so enable it again.

Approved by: jkh

Submitted by: Matthew Reimer <mreimer@vpop.net>


56342 20-Jan-2000 billf

Brucify:
add an upper limit to -t
match the types of return values and the variables they are stuffed in
make the man page and usage() a little more consistantly ugly
less obfuscation.

Submitted by: adrian, billf


55996 14-Jan-2000 billf

Add '-t X' which times out after pinging for X seconds.

Submitted by: adrian


55574 07-Jan-2000 msmith

Don't try to include ipsec support if we are building for the install
floppy image.


55505 06-Jan-2000 shin

libipsec and IPsec related apps. (and some KAME related man pages)

Reviewed by: freebsd-arch, cvs-committers
Obtained from: KAME project


53369 18-Nov-1999 pb

Make last commit bde-compliant:
- correct indentation
- change data types for consistency with the rest of ping.c
- create new variable separate from "answer" for clarity


53191 15-Nov-1999 pb

Fix aliasing bug causing in_cksum() to fail on odd packet sizes
due to compiler optimization.

PR: bin/13292
Suggested by: wollman


50476 28-Aug-1999 peter

$Id$ -> $FreeBSD$


49920 16-Aug-1999 chris

Re-add -Wmissing-prototypes to `COPTS'. I mistook -W for -Wno in this case.


49880 16-Aug-1999 chris

-Wmissing-prototypes is unnecessary here. There are no warnings produced
with this option disabled.


46643 07-May-1999 mckay

Make flood ping flood again. It hasn't worked since 2.2.6. Make the "-l"
option work as described in the manual, not as another flood ping variant.

Once discussed to death with: bde


46080 25-Apr-1999 imp

More egcs warning fixes:
o main returns int not void
o use braces to avoid potentially ambiguous else

Note: The fix to natd is potentially functional in nature since I used
the indentation as the right thing rather than the struct semantics.
Someone more familiar with the code should double check me on this one.

Reviewed by: obrien and chuckr


44138 19-Feb-1999 imp

Finish documenting -S src-addr change.

Forgotten by: me
Forgotten for: Far Too Long
Gently Reminded by: Ruslan Ermilov <ru@ucb.crimea.ua>
Submitted by: Ruslan Ermilov <ru@ucb.crimea.ua>


42337 06-Jan-1999 imp

Allow PINGing from any address on multihomed hosts

In the words of the submitter:
"The patch below allows to ping from any address on the multihomed host.
The man page is also updated, the text was cutted from traceroute(8)."

Submitted by: Ruslan Ermilov
PR: 6832


41409 29-Nov-1998 bde

Fixed non-use of .Nm and hard line breaks in rev.1.16-1.17:


39495 19-Sep-1998 obrien

Remove useless `BINOWN=root' now that it is the default.


38865 05-Sep-1998 dfr

Disable gcc's builtin memcpy for alpha since it doesn't cope with unaligned
regions properly and this triggers an unaligned access trap.


38588 27-Aug-1998 dillon

Updated manual page. Removed description of (now defunct) -c restrictions.


38560 26-Aug-1998 des

Remove -c restrictions from previous commit.


38549 26-Aug-1998 dillon

(well tested at BEST): -i option can now take FP values (e.g. -i 0.1),
extremely useful for networking testing. Other options secured from
user-level D.O.S. attacks. -f, -s now root-only. -i wait times < 1.0
root-only. -c count limited to 100 and defaults to 16 when ping run
by non-root user.


37671 15-Jul-1998 charnier

Correct use of .Nm. Remove unused #includes. Use warn(). cosmetic in usage()
string.
Translate 0 sec 1000000 usec to 1 sec 0 usec.


36713 06-Jun-1998 jb

Fix an alignment problem on alpha by doing a bytewise copy.


36378 25-May-1998 fenner

Use select() timeouts instead of SIGALRM to schedule packet transmission.
Fixes bin/6649 and removes the last abusive signal handler.
Use SO_TIMESTAMP to get the kernel to timestamp packets on reception.
Fixes bin/5658 and provides slightly better accuracy.
Explicitly zero and terminate the IP options when using -R.

PR: bin/5658
PR: bin/6649


36357 25-May-1998 steve

Revert the previous fix. As it turns out Warner Losh is
working a better fix.


36350 25-May-1998 steve

Attempt to stop another DoS attack related to ping flooding.

PR: 6649
Submitted by: Jason Young <doogie@forbidden-donut.anet-stl.com>


36089 16-May-1998 jb

When a timeval is stored at the beginning of icmp_data, the fields
are unaligned for access by the alpha, so copy the value to a variable
that is aligned.

When checking the returned data, be careful to avoid confusing the
size of the icmp header with the size of a timeval. On i386 these
are both 8, but on alpha, a timeval is 16 bytes. This means that
a packet sent from an alpha contains 48 bytes of data, not 56 like
on i386.


35216 15-Apr-1998 phk

If ping write fails with short packet count, the
error message prints the two numbers backwards.
PR: 6313
Reviewed by: phk
Submitted by: Archie Cobbs


34998 02-Apr-1998 imp

Add aback in a line a accidentally killed in my last commit.
Submitted by: Bill Fenner


34995 02-Apr-1998 eivind

Make this compile (and seemingly work).


34976 01-Apr-1998 imp

A fairly rare possible buffer overflow:
Theo fixed this and tqbf reported it
Obtained from: OpenBSD


34673 19-Mar-1998 charnier

.Sh AUTHOR -> .Sh AUTHORS. Use .An/.Aq.


31956 24-Dec-1997 imp

Minor style nit noticed by bde.


31773 16-Dec-1997 bde

Fixed DPADD.


28059 11-Aug-1997 fenner

Add an ntohs() and format an IP address with inet_ntoa() when
printing the details of a received ICMP packet.

PR: bin/3766
Submitted by: denny1@home.com (Denton Gentry)


27945 07-Aug-1997 julian

don't lose track of how many packets we've sent
if we get 'host unreachable'. (or any other errors than ENOBUFS)
makes -c work again even if you can't get there..
This really needs a rework..


27533 20-Jul-1997 bde

Cleaned up revisions 1.22 and 1.23.
Fixed minor bugs in revisions 1.12 and 1.23 (variables assigned to in signal
handlers weren't declared as volatile).


27508 18-Jul-1997 wollman

Calculate and print out the standard deviation of the round trip times.
This isn't necessarily the best statistic, but it is by far the easiest to
calculate. Update the man page to be more explicit about precisely which
statistics are printed out. Revert some of jmg's bogus man page changes from
rev 1.11.


27354 13-Jul-1997 sef

Fix a problem introduced with a recent change that caused a hang with
unreachable hosts. Note that most of this consists of telling SIGINT
and SIGALRM to interrupt the system call, instead of restarting them.
Also try to get rid of some potential races Bruce didn't like; hopefully
they aren't a problem (potential or otherwise) now.

Reviewed by: julian


27301 09-Jul-1997 julian

don't count packets as being transmitted when we know that the sendto()
failed (e.g. ENOBUFS)


27299 09-Jul-1997 julian

ping called printf() from a signal handler..
this is a NO-NO

re-arange to just set a "please die immediatly" flag in the signal handler
and handle this in the normal thread.

also handle ping -f better on slow links by backing off a bit when
we get a ENOBUFFS from the sendto().


23385 04-Mar-1997 imp

Fix typo introduced in 1.17.

Submitted by: "Philippe Charnier" <charnier@xp11.frmug.org>


23327 03-Mar-1997 imp

Check the size of the IP address reutrned from gethostbyname2, per PR
2578 from Julian A. Likely not strictly needed, but it doesn't hurt
and protects ping against possible buffer overflows if the resolver
were to return large IP addresses.


23304 02-Mar-1997 jmg

fix man page to use marcos instead of parens, quotes and braces

plus other minor fixes


23295 02-Mar-1997 imp

1) Minor nits in the usage message from bde. I took out the hard tabs and
used spaces to align the second line under the program name.
2) Cache uid after call to setuid(getuid()) so we don't waste a system call
for each packet with a call to getuid for the -v case.
3) Update manual to reflect new restriction on -l from last delta.

Suggested by: bde, Bill Fenner


23251 02-Mar-1997 imp

1) Fix usage to match convention and manual. Fix manual to match usage.
2) Must be root to run preload (OpenBSD ping.c 1.8)
3) Don't print all replies unless verbose and root (from idea in
OpenBSD ping.c 1.10 and 1.11) to avoid leaking information available
only to root.
4) Remove unused h: from option string to getopt.
5) Make the compiler happy with exit(0) (Lite-2?)

Reviewed by: Dan Cross <tenser@spitfire.ecsel.psu.edu>

Good candidate for 2.2 and 2.1 (as are many of the 1.17 changes).


23247 01-Mar-1997 wollman

Make ping -Wall clean (except for one warning).
Do a better job of argument parsing.
Don't permit ping -f to a multicast address (very antisocial).
Don't permit -L, -I, -T options with unicast addresses.
Ensure that we ask for only AF_INET addresses (should close PR#2584).
Return <sysexits.h> error codes for failures. Document this.
Fix man page to identify the author and put sections in correct order.


22990 22-Feb-1997 peter

Revert $FreeBSD$ to $Id$


22417 08-Feb-1997 danny

Reviewed by: Gary Jennejohn <gj@freebsd.org>
Submitted by: Bruce Murphy <packrat@iinet.net.au>

Add '-a' audible flag, so terminal will beep upon receipt of a reply
packet. Useful for debugging ethernet runs, among other things.


21673 14-Jan-1997 jkh

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


20540 15-Dec-1996 fenner

Add multicast options -I (source interface), -T (set ttl), -L (no loopback).
They were all lowercase in the original, but our ping already uses -i and
-l so I made them all uppercase.

Obtained from: Multicast release 3.5


20280 10-Dec-1996 bde

Cleaned up recent SIGINFO changes.

Simplified average calculations. This also fixes potential overflow errors
and minor rounding inconsistencies (always round to nearest now).

Don't lose more SIGINFOs than necessary.

Print \r at the start of the status message. This clears the dots that
are sometimes left by ping -f.

Reviewed by: sef


20205 08-Dec-1996 pst

Fix typo in last patch. empty!=emtpy


20195 07-Dec-1996 sef

Change how SIGINFO is handled -- set a flag (of sig_atomic_t), and check
that flag on every iteration of the loop. This avoids calling fprintf
inside a signal handler, which is always somewhat icky.

Reviewed by: bde


20099 02-Dec-1996 fenner

Fix math in SIGINFO printer.


19864 19-Nov-1996 sef

Move the terminal handling code to a later location; this allows
the signal handlers to be set up; it also means that a failed name lookup
won't mess up the nokerninfo setting of the tty.

Reviewed by: pst, nate


19395 04-Nov-1996 bde

Fixed backgrounding of ping, which was broken by the ^T changes in rev.1.3.


18718 05-Oct-1996 wosch

delete doubled words, e.g.: "the the" -> "the"


17724 20-Aug-1996 fenner

Print out ICMP errors that are responses to our own packets by default.
Turn this behavior off using '-Q'. This makes '-v' useless other than as
an ICMP-sniffer, which tcpdump is better at anyway.

Print out another couple of ICMP messages, and fix the printing of the
original packet (mostly byte order problems).


17474 09-Aug-1996 fenner

Drop setuid ASAP, to minimize code executed as root.

Reviewed by: pst


17320 28-Jul-1996 peter

Limit the risk of `buf' overrun in ping.c when printing hostnames.

Note, this is not really a security risk, because the buffer in question
is a static variable in the data segment and not on the stack, and hence
cannot subert the flow of execution in any way. About the worst case was
that if you pinged a long hostname, ping could coredump.

Pointed out on: bugtraq (listserv@netspace.org)


8871 30-May-1995 rgrimes

Remove trailing whitespace.


4862 29-Nov-1994 dg

In past releases of FreeBSD, I have used the exit status of "ping" to
determine whether a connection to a given machine is up or not.

In FreeBSD 2.0 (and therefore, I assume, BSD 4.4) the exit code of ping
is always zero, even if no packets were received.

I would like to propose the following change to /usr/src/sbin/ping/ping.c
to restore this useful behaviour:

Submitted by: Denis Fortin


3792 22-Oct-1994 sef

Reviewed by: jkh

Print out summary information on receipt of SIGINFO; also, stop the
kernel printing of information and restore it on exit. Now, it needs
an option to be quiet. ;)


1859 05-Aug-1994 dg

Changed output formatting to accurately represent the precision.


1855 05-Aug-1994 wollman

Convert to our man installation style. Also fixed long-standing bug
in `fastboot'/`fasthalt' in which the interpreter would hang around
after `reboot' or `halt' is run, causing an irritating ``Killed'' message.


1559 26-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1558,
which included commits to RCS files with non-trunk default branches.