Skip site navigation (1)Skip section navigation (2)

CVS log for src/sbin/ping/ping.c

[BACK] Up to [FreeBSD] / src / sbin / ping

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.113.2.1.2.1: download - view: text, markup, annotated - select for diffs
Fri Nov 11 04:20:22 2011 UTC (2 months, 4 weeks ago) by kensmith
Branches: RELENG_9_0
CVS tags: RELENG_9_0_0_RELEASE
Diff to: previous 1.113.2.1: preferred, colored
Changes since revision 1.113.2.1: +0 -0 lines
SVN rev 227445 on 2011-11-11 04:20:22Z by kensmith

Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
cycle.

Approved by:	re (implicit)

Revision 1.113.2.1: download - view: text, markup, annotated - select for diffs
Fri Sep 23 00:51:37 2011 UTC (4 months, 2 weeks ago) by kensmith
Branches: RELENG_9
CVS tags: RELENG_9_0_BP
Branch point for: RELENG_9_0
Diff to: previous 1.113: preferred, colored
Changes since revision 1.113: +0 -0 lines
SVN rev 225736 on 2011-09-23 00:51:37Z by kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by:	re (implicit)

Revision 1.112.14.1: download - view: text, markup, annotated - select for diffs
Tue Dec 21 17:10:29 2010 UTC (13 months, 2 weeks ago) by kensmith
Branches: RELENG_7_4
CVS tags: RELENG_7_4_0_RELEASE
Diff to: previous 1.112: preferred, colored; next MAIN 1.113: preferred, colored
Changes since revision 1.112: +0 -0 lines
SVN rev 216618 on 2010-12-21 17:10:29Z by kensmith

Copy stable/7 to releng/7.4 in preparation for FreeBSD-7.4 release.

Approved by:	re (implicit)

Revision 1.112.10.1.6.1: download - view: text, markup, annotated - select for diffs
Tue Dec 21 17:09:25 2010 UTC (13 months, 2 weeks ago) by kensmith
Branches: RELENG_8_2
CVS tags: RELENG_8_2_0_RELEASE
Diff to: previous 1.112.10.1: preferred, colored; next MAIN 1.112.12.1: preferred, colored
Changes since revision 1.112.10.1: +0 -0 lines
SVN rev 216617 on 2010-12-21 17:09:25Z by kensmith

Copy stable/8 to releng/8.2 in preparation for FreeBSD-8.2 release.

Approved by:	re (implicit)

Revision 1.113: download - view: text, markup, annotated - select for diffs
Sun Jun 20 12:52:33 2010 UTC (19 months, 3 weeks ago) by ed
Branches: MAIN
CVS tags: RELENG_9_BP, HEAD
Branch point for: RELENG_9
Diff to: previous 1.112: preferred, colored
Changes since revision 1.112: +16 -32 lines
SVN rev 209366 on 2010-06-20 12:52:33Z by ed

Small style fixes:

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

Revision 1.112.10.1.4.1: download - view: text, markup, annotated - select for diffs
Mon Jun 14 02:09:06 2010 UTC (19 months, 3 weeks ago) by kensmith
Branches: RELENG_8_1
CVS tags: RELENG_8_1_0_RELEASE
Diff to: previous 1.112.10.1: preferred, colored; next MAIN 1.112.12.1: preferred, colored
Changes since revision 1.112.10.1: +0 -0 lines
SVN rev 209145 on 2010-06-14 02:09:06Z by kensmith

Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.

Approved by:	re (implicit)

Revision 1.112.12.1: download - view: text, markup, annotated - select for diffs
Wed Feb 10 00:26:20 2010 UTC (23 months, 4 weeks ago) by kensmith
Branches: RELENG_7_3
CVS tags: RELENG_7_3_0_RELEASE
Diff to: previous 1.112: preferred, colored; next MAIN 1.113: preferred, colored
Changes since revision 1.112: +0 -0 lines
SVN rev 203736 on 2010-02-10 00:26:20Z by kensmith

Copy stable/7 to releng/7.3 as part of the 7.3-RELEASE process.

Approved by:	re (implicit)

Revision 1.112.10.1.2.1: download - view: text, markup, annotated - select for diffs
Sun Oct 25 01:10:29 2009 UTC (2 years, 3 months ago) by kensmith
Branches: RELENG_8_0
CVS tags: RELENG_8_0_0_RELEASE
Diff to: previous 1.112.10.1: preferred, colored; next MAIN 1.112.12.1: preferred, colored
Changes since revision 1.112.10.1: +0 -0 lines
SVN rev 198460 on 2009-10-25 01:10:29Z by kensmith

Copy stable/8 to releng/8.0 as part of 8.0-RELEASE release procedure.

Approved by:	re (implicit)

Revision 1.112.10.1: download - view: text, markup, annotated - select for diffs
Mon Aug 3 08:13:06 2009 UTC (2 years, 6 months ago) by kensmith
Branches: RELENG_8
CVS tags: RELENG_8_2_BP, RELENG_8_1_BP, RELENG_8_0_BP
Branch point for: RELENG_8_2, RELENG_8_1, RELENG_8_0
Diff to: previous 1.112: preferred, colored; next MAIN 1.113: preferred, colored
Changes since revision 1.112: +0 -0 lines
SVN rev 196045 on 2009-08-03 08:13:06Z by kensmith

Copy head to stable/8 as part of 8.0 Release cycle.

Approved by:	re (Implicit)

Revision 1.112.8.1: download - view: text, markup, annotated - select for diffs
Wed Apr 15 03:14:26 2009 UTC (2 years, 9 months ago) by kensmith
Branches: RELENG_7_2
CVS tags: RELENG_7_2_0_RELEASE
Diff to: previous 1.112: preferred, colored; next MAIN 1.113: preferred, colored
Changes since revision 1.112: +0 -0 lines
SVN rev 191087 on 2009-04-15 03:14:26Z by kensmith

Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.

Approved by:	re (implicit)

Revision 1.112.6.1: download - view: text, markup, annotated - select for diffs
Tue Nov 25 02:59:29 2008 UTC (3 years, 2 months ago) by kensmith
Branches: RELENG_7_1
CVS tags: RELENG_7_1_0_RELEASE
Diff to: previous 1.112: preferred, colored; next MAIN 1.113: preferred, colored
Changes since revision 1.112: +0 -0 lines
SVN rev 185281 on 2008-11-25 02:59:29Z by kensmith

Create releng/7.1 in preparation for moving into RC phase of 7.1 release
cycle.

Approved by:	re (implicit)

Revision 1.106.2.2.6.1: download - view: text, markup, annotated - select for diffs
Thu Oct 2 02:57:24 2008 UTC (3 years, 4 months ago) by kensmith
Branches: RELENG_6_4
CVS tags: RELENG_6_4_0_RELEASE
Diff to: previous 1.106.2.2: preferred, colored; next MAIN 1.107: preferred, colored
Changes since revision 1.106.2.2: +0 -0 lines
SVN rev 183531 on 2008-10-02 02:57:24Z by kensmith

Create releng/6.4 from stable/6 in preparation for 6.4-RC1.

Approved by:	re (implicit)

Revision 1.112: download - view: text, markup, annotated - select for diffs
Sun Jul 1 12:08:06 2007 UTC (4 years, 7 months ago) by gnn
Branches: MAIN
CVS tags: RELENG_8_BP, RELENG_7_BP, RELENG_7_4_BP, RELENG_7_3_BP, RELENG_7_2_BP, RELENG_7_1_BP, RELENG_7_0_BP, RELENG_7_0_0_RELEASE, RELENG_7_0, RELENG_7
Branch point for: RELENG_8, RELENG_7_4, RELENG_7_3, RELENG_7_2, RELENG_7_1
Diff to: previous 1.111: preferred, colored
Changes since revision 1.111: +1 -1 lines
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

Revision 1.111: download - view: text, markup, annotated - select for diffs
Mon May 21 14:38:45 2007 UTC (4 years, 8 months ago) by cognet
Branches: MAIN
Diff to: previous 1.110: preferred, colored
Changes since revision 1.110: +1 -1 lines
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.

Revision 1.110: download - view: text, markup, annotated - select for diffs
Mon Aug 14 07:54:17 2006 UTC (5 years, 5 months ago) by dd
Branches: MAIN
Diff to: previous 1.109: preferred, colored
Changes since revision 1.109: +4 -4 lines
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.

Revision 1.106.2.2: download - view: text, markup, annotated - select for diffs
Thu Aug 10 10:48:21 2006 UTC (5 years, 6 months ago) by glebius
Branches: RELENG_6
CVS tags: RELENG_6_4_BP, RELENG_6_3_BP, RELENG_6_3_0_RELEASE, RELENG_6_3, RELENG_6_2_BP, RELENG_6_2_0_RELEASE, RELENG_6_2
Branch point for: RELENG_6_4
Diff to: previous 1.106.2.1: preferred, colored; branchpoint 1.106: preferred, colored; next MAIN 1.107: preferred, colored
Changes since revision 1.106.2.1: +31 -10 lines
MFC:
  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>

Revision 1.109: download - view: text, markup, annotated - select for diffs
Wed Apr 5 12:30:42 2006 UTC (5 years, 10 months ago) by glebius
Branches: MAIN
Diff to: previous 1.108: preferred, colored
Changes since revision 1.108: +28 -7 lines
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>

Revision 1.108: download - view: text, markup, annotated - select for diffs
Thu Dec 1 22:03:34 2005 UTC (6 years, 2 months ago) by ru
Branches: MAIN
Diff to: previous 1.107: preferred, colored
Changes since revision 1.107: +4 -4 lines
Sync usage() with SYNOPSIS.

Revision 1.105.2.2: download - view: text, markup, annotated - select for diffs
Thu Nov 3 12:42:21 2005 UTC (6 years, 3 months ago) by glebius
Branches: RELENG_5
CVS tags: RELENG_5_5_BP, RELENG_5_5_0_RELEASE, RELENG_5_5
Diff to: previous 1.105.2.1: preferred, colored; branchpoint 1.105: preferred, colored; next MAIN 1.106: preferred, colored
Changes since revision 1.105.2.1: +93 -6 lines
MFC:
  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)

Revision 1.106.2.1: download - view: text, markup, annotated - select for diffs
Fri Aug 19 09:29:25 2005 UTC (6 years, 5 months ago) by glebius
Branches: RELENG_6
CVS tags: RELENG_6_1_BP, RELENG_6_1_0_RELEASE, RELENG_6_1, RELENG_6_0_BP, RELENG_6_0_0_RELEASE, RELENG_6_0
Diff to: previous 1.106: preferred, colored
Changes since revision 1.106: +93 -6 lines
MFC:
  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)

Approved by:	re (kensmith)

Revision 1.107: download - view: text, markup, annotated - select for diffs
Mon Aug 15 14:15:37 2005 UTC (6 years, 5 months ago) by glebius
Branches: MAIN
Diff to: previous 1.106: preferred, colored
Changes since revision 1.106: +93 -6 lines
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)

Revision 1.105.2.1: download - view: text, markup, annotated - select for diffs
Tue Nov 9 18:11:46 2004 UTC (7 years, 3 months ago) by maxim
Branches: RELENG_5
CVS tags: RELENG_5_4_BP, RELENG_5_4_0_RELEASE, RELENG_5_4
Diff to: previous 1.105: preferred, colored
Changes since revision 1.105: +15 -4 lines
MFC rev. 1.106: store timestamp in network byte order, remove
an assumption sizeof(struct timeval) == 8.

Revision 1.106: download - view: text, markup, annotated - select for diffs
Thu Sep 30 07:35:56 2004 UTC (7 years, 4 months ago) by maxim
Branches: MAIN
CVS tags: RELENG_6_BP
Branch point for: RELENG_6
Diff to: previous 1.105: preferred, colored
Changes since revision 1.105: +15 -4 lines
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

Revision 1.105: download - view: text, markup, annotated - select for diffs
Sat Aug 14 17:46:10 2004 UTC (7 years, 5 months ago) by stefanf
Branches: MAIN
CVS tags: RELENG_5_BP, RELENG_5_3_BP, RELENG_5_3_0_RELEASE, RELENG_5_3
Branch point for: RELENG_5
Diff to: previous 1.104: preferred, colored
Changes since revision 1.104: +1 -1 lines
Avoid using void pointers in additive expressions.

PR:		56653

Revision 1.104: download - view: text, markup, annotated - select for diffs
Fri Apr 9 19:58:34 2004 UTC (7 years, 10 months ago) by markm
Branches: MAIN
Diff to: previous 1.103: preferred, colored
Changes since revision 1.103: +0 -4 lines
Remove advertising clause from University of California Regent's license,
per letter dated July 22, 1999.

Approved by: core, imp

Revision 1.103: download - view: text, markup, annotated - select for diffs
Wed Apr 7 18:48:11 2004 UTC (7 years, 10 months ago) by iedowse
Branches: MAIN
Diff to: previous 1.102: preferred, colored
Changes since revision 1.102: +0 -14 lines
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

Revision 1.52.2.14: download - view: text, markup, annotated - select for diffs
Sun Feb 29 21:05:18 2004 UTC (7 years, 11 months ago) by iedowse
Branches: RELENG_4
CVS tags: RELENG_4_11_BP, RELENG_4_11_0_RELEASE, RELENG_4_11, RELENG_4_10_BP, RELENG_4_10_0_RELEASE, RELENG_4_10
Diff to: previous 1.52.2.13: preferred, colored; branchpoint 1.52: preferred, colored; next MAIN 1.53: preferred, colored
Changes since revision 1.52.2.13: +6 -0 lines
MFC: 1.102; exit immediately if a second SIGINT is received, to
avoid long delays where ^C is ineffective during certain DNS lokups.

Revision 1.102: download - view: text, markup, annotated - select for diffs
Sun Feb 8 21:59:17 2004 UTC (8 years ago) by iedowse
Branches: MAIN
Diff to: previous 1.101: preferred, colored
Changes since revision 1.101: +6 -0 lines
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

Revision 1.101: download - view: text, markup, annotated - select for diffs
Mon Jul 14 12:43:48 2003 UTC (8 years, 6 months ago) by maxim
Branches: MAIN
CVS tags: RELENG_5_2_BP, RELENG_5_2_1_RELEASE, RELENG_5_2_0_RELEASE, RELENG_5_2
Diff to: previous 1.100: preferred, colored
Changes since revision 1.100: +7 -7 lines
o Rename local variables, do not shadow global declarations.

Revision 1.100: download - view: text, markup, annotated - select for diffs
Mon Jul 14 12:42:47 2003 UTC (8 years, 6 months ago) by maxim
Branches: MAIN
Diff to: previous 1.99: preferred, colored
Changes since revision 1.99: +6 -7 lines
o Kill MINICMPLEN, there is ICMP_MINLEN already.

Revision 1.99: download - view: text, markup, annotated - select for diffs
Mon Jul 14 12:37:03 2003 UTC (8 years, 6 months ago) by maxim
Branches: MAIN
Diff to: previous 1.98: preferred, colored
Changes since revision 1.98: +18 -11 lines
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

Revision 1.98: download - view: text, markup, annotated - select for diffs
Mon Jun 2 10:01:59 2003 UTC (8 years, 8 months ago) by maxim
Branches: MAIN
Diff to: previous 1.97: preferred, colored
Changes since revision 1.97: +6 -6 lines
Fix SIGINFO handling: do not print incorrect timing statistics
when the data for it is not available.

Founded by:	ping -s0 localhost; press ^T

Revision 1.97: download - view: text, markup, annotated - select for diffs
Sat May 3 18:41:58 2003 UTC (8 years, 9 months ago) by obrien
Branches: MAIN
CVS tags: RELENG_5_1_BP, RELENG_5_1_0_RELEASE, RELENG_5_1
Diff to: previous 1.96: preferred, colored
Changes since revision 1.96: +4 -4 lines
Use __FBSDID() to quiet GCC 3.3 warnings.

Revision 1.96: download - view: text, markup, annotated - select for diffs
Mon Apr 14 08:34:14 2003 UTC (8 years, 9 months ago) by maxim
Branches: MAIN
Diff to: previous 1.95: preferred, colored
Changes since revision 1.95: +8 -2 lines
o Skip timestamp part when checking payload.

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

Revision 1.95: download - view: text, markup, annotated - select for diffs
Mon Apr 7 12:05:50 2003 UTC (8 years, 10 months ago) by mdodd
Branches: MAIN
Diff to: previous 1.94: preferred, colored
Changes since revision 1.94: +17 -12 lines
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>

Revision 1.94: download - view: text, markup, annotated - select for diffs
Wed Apr 2 20:14:43 2003 UTC (8 years, 10 months ago) by mdodd
Branches: MAIN
Diff to: previous 1.93: preferred, colored
Changes since revision 1.93: +1 -13 lines
Back out support for RFC3514.

RFC3514 poses an unacceptale risk to compliant systems.

Revision 1.93: download - view: text, markup, annotated - select for diffs
Wed Apr 2 14:52:21 2003 UTC (8 years, 10 months ago) by maxim
Branches: MAIN
Diff to: previous 1.92: preferred, colored
Changes since revision 1.92: +2 -2 lines
IP_EVIL -> IP_EF

Revision 1.92: download - view: text, markup, annotated - select for diffs
Tue Apr 1 08:21:43 2003 UTC (8 years, 10 months ago) by mdodd
Branches: MAIN
Diff to: previous 1.91: preferred, colored
Changes since revision 1.91: +13 -1 lines
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.

Revision 1.91: download - view: text, markup, annotated - select for diffs
Fri Mar 28 00:31:51 2003 UTC (8 years, 10 months ago) by mdodd
Branches: MAIN
Diff to: previous 1.90: preferred, colored
Changes since revision 1.90: +1 -1 lines
Default data length should be 56, not 64.

Revision 1.90: download - view: text, markup, annotated - select for diffs
Mon Mar 24 23:48:36 2003 UTC (8 years, 10 months ago) by mdodd
Branches: MAIN
Diff to: previous 1.89: preferred, colored
Changes since revision 1.89: +21 -22 lines
- 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>

Revision 1.89: download - view: text, markup, annotated - select for diffs
Mon Mar 24 11:26:08 2003 UTC (8 years, 10 months ago) by bde
Branches: MAIN
Diff to: previous 1.88: preferred, colored
Changes since revision 1.88: +2 -2 lines
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).

Revision 1.88: download - view: text, markup, annotated - select for diffs
Fri Mar 14 07:59:38 2003 UTC (8 years, 10 months ago) by ru
Branches: MAIN
Diff to: previous 1.87: preferred, colored
Changes since revision 1.87: +8 -15 lines
Demangle the usage message at the source level.

Submitted by:	bde

Revision 1.87: download - view: text, markup, annotated - select for diffs
Tue Mar 11 20:12:39 2003 UTC (8 years, 11 months ago) by ru
Branches: MAIN
Diff to: previous 1.86: preferred, colored
Changes since revision 1.86: +12 -12 lines
Fix and sync SYNOPSIS and usage().

Prodded by:	bde

Revision 1.86: download - view: text, markup, annotated - select for diffs
Wed Mar 5 22:42:03 2003 UTC (8 years, 11 months ago) by seanc
Branches: MAIN
Diff to: previous 1.85: preferred, colored
Changes since revision 1.85: +35 -26 lines
Update ping to be WARNS=2 compliant.

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

Revision 1.85: download - view: text, markup, annotated - select for diffs
Sun Mar 2 21:24:08 2003 UTC (8 years, 11 months ago) by mdodd
Branches: MAIN
Diff to: previous 1.84: preferred, colored
Changes since revision 1.84: +94 -28 lines
Support ICMP_TSTAMP/ICMP_TSTAMPREPLY.

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

Revision 1.84: download - view: text, markup, annotated - select for diffs
Sun Feb 23 01:50:07 2003 UTC (8 years, 11 months ago) by ru
Branches: MAIN
Diff to: previous 1.83: preferred, colored
Changes since revision 1.83: +40 -40 lines
Sort options.

Revision 1.83: download - view: text, markup, annotated - select for diffs
Wed Jan 29 20:42:42 2003 UTC (9 years ago) by mdodd
Branches: MAIN
Diff to: previous 1.82: preferred, colored
Changes since revision 1.82: +6 -3 lines
Call fill() after maxpayload has been initialized.

Reviewed by:	 maxim

Revision 1.82: download - view: text, markup, annotated - select for diffs
Tue Jan 28 22:53:24 2003 UTC (9 years ago) by mdodd
Branches: MAIN
Diff to: previous 1.81: preferred, colored
Changes since revision 1.81: +22 -6 lines
Send ICMP_MASKREQ packets when the '-M' option is specified.

Revision 1.81: download - view: text, markup, annotated - select for diffs
Thu Jan 23 13:04:42 2003 UTC (9 years ago) by maxim
Branches: MAIN
Diff to: previous 1.80: preferred, colored
Changes since revision 1.80: +14 -10 lines
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

Revision 1.80: download - view: text, markup, annotated - select for diffs
Thu Jan 23 12:56:10 2003 UTC (9 years ago) by maxim
Branches: MAIN
Diff to: previous 1.79: preferred, colored
Changes since revision 1.79: +30 -37 lines
style(9) sweep.

Submitted by:	bde

Revision 1.79: download - view: text, markup, annotated - select for diffs
Thu Jan 23 12:54:11 2003 UTC (9 years ago) by maxim
Branches: MAIN
Diff to: previous 1.78: preferred, colored
Changes since revision 1.78: +2 -2 lines
Anti-magic: s/255/MAXTTL/

Revision 1.78: download - view: text, markup, annotated - select for diffs
Thu Jan 23 12:48:12 2003 UTC (9 years ago) by maxim
Branches: MAIN
Diff to: previous 1.77: preferred, colored
Changes since revision 1.77: +57 -7 lines
Implement -D (do not fragment) and -z (TOS) options.

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

Revision 1.77: download - view: text, markup, annotated - select for diffs
Thu Jan 23 12:42:56 2003 UTC (9 years ago) by maxim
Branches: MAIN
Diff to: previous 1.76: preferred, colored
Changes since revision 1.76: +3 -1 lines
Print strict source routing option.

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

Revision 1.52.2.13: download - view: text, markup, annotated - select for diffs
Tue Oct 29 10:23:21 2002 UTC (9 years, 3 months ago) by maxim
Branches: RELENG_4
CVS tags: RELENG_4_9_BP, RELENG_4_9_0_RELEASE, RELENG_4_9, RELENG_4_8_BP, RELENG_4_8_0_RELEASE, RELENG_4_8
Diff to: previous 1.52.2.12: preferred, colored; branchpoint 1.52: preferred, colored
Changes since revision 1.52.2.12: +77 -81 lines
MFC revs. 1.67, 1.68, 1.76:
o Strict ip options parsing.
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.

Revision 1.76: download - view: text, markup, annotated - select for diffs
Mon Oct 21 11:43:46 2002 UTC (9 years, 3 months ago) by maxim
Branches: MAIN
CVS tags: RELENG_5_0_BP, RELENG_5_0_0_RELEASE, RELENG_5_0
Diff to: previous 1.75: preferred, colored
Changes since revision 1.75: +2 -1 lines
Fix LSRR option length check: it has to be less or equal remained header's
length minus sizeof(struct ip).

MFC after:	1 week

Revision 1.75: download - view: text, markup, annotated - select for diffs
Wed Oct 2 03:24:27 2002 UTC (9 years, 4 months ago) by dd
Branches: MAIN
Diff to: previous 1.74: preferred, colored
Changes since revision 1.74: +8 -3 lines
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

Revision 1.52.2.12: download - view: text, markup, annotated - select for diffs
Tue Sep 17 15:33:49 2002 UTC (9 years, 4 months ago) by nectar
Branches: RELENG_4
CVS tags: RELENG_4_7_BP, RELENG_4_7_0_RELEASE, RELENG_4_7
Diff to: previous 1.52.2.11: preferred, colored; branchpoint 1.52: preferred, colored
Changes since revision 1.52.2.11: +2 -0 lines
MFC 1.71, 1.72: Check for FD_SET overruns.

Approved by:	re (jhb)

Revision 1.74: download - view: text, markup, annotated - select for diffs
Wed Sep 11 18:16:40 2002 UTC (9 years, 5 months ago) by peter
Branches: MAIN
Diff to: previous 1.73: preferred, colored
Changes since revision 1.73: +5 -5 lines
Commit "unrelated style fixes" part of Bruce's patch (regarding
bcopy/memcpy) seperately.

Submitted by:  bde

Revision 1.73: download - view: text, markup, annotated - select for diffs
Wed Sep 11 18:12:29 2002 UTC (9 years, 5 months ago) by peter
Branches: MAIN
Diff to: previous 1.72: preferred, colored
Changes since revision 1.72: +5 -5 lines
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

Revision 1.72: download - view: text, markup, annotated - select for diffs
Mon Sep 9 18:51:59 2002 UTC (9 years, 5 months ago) by nectar
Branches: MAIN
Diff to: previous 1.71: preferred, colored
Changes since revision 1.71: +2 -4 lines
In reference to previous commit: use err(3).

Noticed by:	bde

Revision 1.71: download - view: text, markup, annotated - select for diffs
Mon Sep 9 15:58:08 2002 UTC (9 years, 5 months ago) by nectar
Branches: MAIN
Diff to: previous 1.70: preferred, colored
Changes since revision 1.70: +4 -0 lines
Check for FD_SET overrun.

Revision 1.52.2.11: download - view: text, markup, annotated - select for diffs
Sat Aug 31 19:30:16 2002 UTC (9 years, 5 months ago) by iedowse
Branches: RELENG_4
Diff to: previous 1.52.2.10: preferred, colored; branchpoint 1.52: preferred, colored
Changes since revision 1.52.2.10: +1 -1 lines
MFC: 1.70; fix usage line.

Revision 1.70: download - view: text, markup, annotated - select for diffs
Tue Aug 27 08:09:37 2002 UTC (9 years, 5 months ago) by iedowse
Branches: MAIN
Diff to: previous 1.69: preferred, colored
Changes since revision 1.69: +1 -1 lines
Add the -A flag to the usage line.

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

Revision 1.69: download - view: text, markup, annotated - select for diffs
Sat Aug 10 03:00:55 2002 UTC (9 years, 6 months ago) by peter
Branches: MAIN
Diff to: previous 1.68: preferred, colored
Changes since revision 1.68: +2 -2 lines
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.

Revision 1.68: download - view: text, markup, annotated - select for diffs
Fri Jul 5 11:52:54 2002 UTC (9 years, 7 months ago) by maxim
Branches: MAIN
Diff to: previous 1.67: preferred, colored
Changes since revision 1.67: +32 -28 lines
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

Revision 1.67: download - view: text, markup, annotated - select for diffs
Fri Jul 5 11:47:33 2002 UTC (9 years, 7 months ago) by maxim
Branches: MAIN
Diff to: previous 1.66: preferred, colored
Changes since revision 1.66: +44 -53 lines
More strict ip options parsing.

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

Revision 1.52.2.10: download - view: text, markup, annotated - select for diffs
Thu Apr 25 06:27:04 2002 UTC (9 years, 9 months ago) by maxim
Branches: RELENG_4
CVS tags: RELENG_4_6_BP, RELENG_4_6_2_RELEASE, RELENG_4_6_1_RELEASE, RELENG_4_6_0_RELEASE, RELENG_4_6
Diff to: previous 1.52.2.9: preferred, colored; branchpoint 1.52: preferred, colored
Changes since revision 1.52.2.9: +101 -97 lines
MFC
	rev. 1.63: remove 'register' keyword,
	rev. 1.64 and 1.65: style(9),
	rev. 1.66: WARNS fixes.

MFC 1.63 and 1.64 are OK'ed by:	obrien

Revision 1.66: download - view: text, markup, annotated - select for diffs
Tue Apr 2 10:15:32 2002 UTC (9 years, 10 months ago) by maxim
Branches: MAIN
Diff to: previous 1.65: preferred, colored
Changes since revision 1.65: +3 -3 lines
WARNS fixes.

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

Revision 1.65: download - view: text, markup, annotated - select for diffs
Tue Apr 2 09:36:46 2002 UTC (9 years, 10 months ago) by maxim
Branches: MAIN
Diff to: previous 1.64: preferred, colored
Changes since revision 1.64: +53 -57 lines
style(9) cleanup.

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

Revision 1.64: download - view: text, markup, annotated - select for diffs
Sat Mar 23 18:10:59 2002 UTC (9 years, 10 months ago) by obrien
Branches: MAIN
Diff to: previous 1.63: preferred, colored
Changes since revision 1.63: +41 -33 lines
Style(9) local vars after 'register' removal.

Requested by:	bde

Revision 1.63: download - view: text, markup, annotated - select for diffs
Wed Mar 20 17:55:08 2002 UTC (9 years, 10 months ago) by obrien
Branches: MAIN
Diff to: previous 1.62: preferred, colored
Changes since revision 1.62: +13 -13 lines
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?)

Revision 1.62: download - view: text, markup, annotated - select for diffs
Wed Feb 27 22:37:22 2002 UTC (9 years, 11 months ago) by fenner
Branches: MAIN
Diff to: previous 1.61: preferred, colored
Changes since revision 1.61: +8 -6 lines
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.

Revision 1.52.2.9: download - view: text, markup, annotated - select for diffs
Fri Feb 1 08:31:31 2002 UTC (10 years ago) by ru
Branches: RELENG_4
Diff to: previous 1.52.2.8: preferred, colored; branchpoint 1.52: preferred, colored
Changes since revision 1.52.2.8: +10 -6 lines
MFC: Fixed bugs with the "-l preload" option:

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

Revision 1.61: download - view: text, markup, annotated - select for diffs
Mon Jan 14 14:33:35 2002 UTC (10 years ago) by ru
Branches: MAIN
Diff to: previous 1.60: preferred, colored
Changes since revision 1.60: +10 -6 lines
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

Revision 1.52.2.8: download - view: text, markup, annotated - select for diffs
Tue Oct 2 15:56:03 2001 UTC (10 years, 4 months ago) by ru
Branches: RELENG_4
CVS tags: RELENG_4_5_BP, RELENG_4_5_0_RELEASE, RELENG_4_5
Diff to: previous 1.52.2.7: preferred, colored; branchpoint 1.52: preferred, colored
Changes since revision 1.52.2.7: +15 -3 lines
MFC: -A option (not that it's fixed).

Prodded by:	Igor Kucherenko <kivvy@sunbay.com>

Revision 1.60: download - view: text, markup, annotated - select for diffs
Tue Sep 25 20:22:33 2001 UTC (10 years, 4 months ago) by iedowse
Branches: MAIN
Diff to: previous 1.59: preferred, colored
Changes since revision 1.59: +7 -3 lines
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

Revision 1.52.2.7: download - view: text, markup, annotated - select for diffs
Mon Aug 20 03:41:47 2001 UTC (10 years, 5 months ago) by fenner
Branches: RELENG_4
CVS tags: RELENG_4_4_BP, RELENG_4_4_0_RELEASE, RELENG_4_4
Diff to: previous 1.52.2.6: preferred, colored; branchpoint 1.52: preferred, colored
Changes since revision 1.52.2.6: +6 -1 lines
MFC rev 1.57: increase send socket buffer to 48k

Approved by:	murray

Revision 1.52.2.6: download - view: text, markup, annotated - select for diffs
Mon Jul 30 00:55:44 2001 UTC (10 years, 6 months ago) by mjacob
Branches: RELENG_4
Diff to: previous 1.52.2.5: preferred, colored; branchpoint 1.52: preferred, colored
Changes since revision 1.52.2.5: +3 -11 lines
Revert MFC of phk's -A changes- there is some question that they don't work
correctly. This may be incorrect, but I probably should not have been the
one to MFC them to begin with. Bad me.

Revision 1.52.2.5: download - view: text, markup, annotated - select for diffs
Sun Jul 29 23:52:03 2001 UTC (10 years, 6 months ago) by mjacob
Branches: RELENG_4
Diff to: previous 1.52.2.4: preferred, colored; branchpoint 1.52: preferred, colored
Changes since revision 1.52.2.4: +8 -9 lines
MFC revs 1.58-1.59: address alignment issues.

Revision 1.52.2.4: download - view: text, markup, annotated - select for diffs
Sun Jul 29 23:50:12 2001 UTC (10 years, 6 months ago) by mjacob
Branches: RELENG_4
Diff to: previous 1.52.2.3: preferred, colored; branchpoint 1.52: preferred, colored
Changes since revision 1.52.2.3: +11 -3 lines
MFC phk's '-A' changes.

Revision 1.59: download - view: text, markup, annotated - select for diffs
Sat Jul 7 19:09:21 2001 UTC (10 years, 7 months ago) by mjacob
Branches: MAIN
Diff to: previous 1.58: preferred, colored
Changes since revision 1.58: +8 -17 lines
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

Revision 1.58: download - view: text, markup, annotated - select for diffs
Sat Jul 7 05:01:06 2001 UTC (10 years, 7 months ago) by mjacob
Branches: MAIN
Diff to: previous 1.57: preferred, colored
Changes since revision 1.57: +10 -2 lines
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.

Revision 1.57: download - view: text, markup, annotated - select for diffs
Sat Jun 30 06:46:33 2001 UTC (10 years, 7 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.56: preferred, colored
Changes since revision 1.56: +6 -1 lines
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

Revision 1.56: download - view: text, markup, annotated - select for diffs
Thu May 24 09:17:52 2001 UTC (10 years, 8 months ago) by phk
Branches: MAIN
Diff to: previous 1.55: preferred, colored
Changes since revision 1.55: +11 -3 lines
Add a -A option to ping which beeps when packets are lost.

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

Revision 1.52.2.3: download - view: text, markup, annotated - select for diffs
Wed Apr 25 12:30:01 2001 UTC (10 years, 9 months ago) by ru
Branches: RELENG_4
Diff to: previous 1.52.2.2: preferred, colored; branchpoint 1.52: preferred, colored
Changes since revision 1.52.2.2: +29 -13 lines
MFC: new option -m to set IP TTL.

Revision 1.55: download - view: text, markup, annotated - select for diffs
Fri Mar 9 13:20:23 2001 UTC (10 years, 11 months ago) by ru
Branches: MAIN
Diff to: previous 1.54: preferred, colored
Changes since revision 1.54: +29 -13 lines
Add new option -m which allows the user to set IP TTL.

Revision 1.52.2.2: download - view: text, markup, annotated - select for diffs
Sun Feb 18 02:23:56 2001 UTC (10 years, 11 months ago) by kris
Branches: RELENG_4
CVS tags: RELENG_4_3_BP, RELENG_4_3_0_RELEASE, RELENG_4_3
Diff to: previous 1.52.2.1: preferred, colored; branchpoint 1.52: preferred, colored
Changes since revision 1.52.2.1: +3 -3 lines
MFC: Format string paranoia

Revision 1.54: download - view: text, markup, annotated - select for diffs
Sun Nov 19 13:28:07 2000 UTC (11 years, 2 months ago) by kris
Branches: MAIN
Diff to: previous 1.53: preferred, colored
Changes since revision 1.53: +3 -3 lines
Format string paranoia

Revision 1.52.2.1: download - view: text, markup, annotated - select for diffs
Tue Mar 28 18:04:16 2000 UTC (11 years, 10 months ago) by shin
Branches: RELENG_4
CVS tags: RELENG_4_2_0_RELEASE, RELENG_4_1_1_RELEASE, RELENG_4_1_0_RELEASE
Diff to: previous 1.52: preferred, colored
Changes since revision 1.52: +2 -2 lines
MFC:
use CMSG_LEN() to compute ping SCM_TIMESTAMP cmsg_len.
Without this, cmsg_len size should be smaller than necessary on alpha.

Revision 1.53: download - view: text, markup, annotated - select for diffs
Tue Mar 14 17:37:19 2000 UTC (11 years, 10 months ago) by shin
Branches: MAIN
CVS tags: PRE_SMPNG
Diff to: previous 1.52: preferred, colored
Changes since revision 1.52: +2 -2 lines
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.)

Revision 1.52: download - view: text, markup, annotated - select for diffs
Fri Mar 3 11:13:12 2000 UTC (11 years, 11 months ago) by shin
Branches: MAIN
CVS tags: RELENG_4_BP, RELENG_4_0_0_RELEASE
Branch point for: RELENG_4
Diff to: previous 1.51: preferred, colored
Changes since revision 1.51: +2 -2 lines
CMSG_XXX macros alignment fixes to follow RFC2292.

Approved by: jkh

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

Revision 1.51: download - view: text, markup, annotated - select for diffs
Tue Feb 8 05:07:50 2000 UTC (12 years ago) by shin
Branches: MAIN
Diff to: previous 1.50: preferred, colored
Changes since revision 1.50: +3 -3 lines
ping -S option was missing from IPsec merge, so enable it again.

Approved by: jkh

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

Revision 1.50: download - view: text, markup, annotated - select for diffs
Thu Jan 20 20:48:51 2000 UTC (12 years ago) by billf
Branches: MAIN
Diff to: previous 1.49: preferred, colored
Changes since revision 1.49: +16 -9 lines
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

Revision 1.49: download - view: text, markup, annotated - select for diffs
Fri Jan 14 23:40:38 2000 UTC (12 years ago) by billf
Branches: MAIN
Diff to: previous 1.48: preferred, colored
Changes since revision 1.48: +16 -5 lines
Add '-t X' which times out after pinging for X seconds.

Submitted by:	adrian

Revision 1.48: download - view: text, markup, annotated - select for diffs
Thu Jan 6 12:40:36 2000 UTC (12 years, 1 month ago) by shin
Branches: MAIN
Diff to: previous 1.47: preferred, colored
Changes since revision 1.47: +69 -4 lines
libipsec and IPsec related apps. (and some KAME related man pages)

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

Revision 1.42.2.3: download - view: text, markup, annotated - select for diffs
Tue Nov 30 21:55:17 1999 UTC (12 years, 2 months ago) by pb
Branches: RELENG_3
CVS tags: RELENG_3_5_0_RELEASE, RELENG_3_4_0_RELEASE
Diff to: previous 1.42.2.2: preferred, colored; branchpoint 1.42: preferred, colored; next MAIN 1.43: preferred, colored
Changes since revision 1.42.2.2: +9 -4 lines
MFC: make in_cksum() for odd-sized packets portable WRT compiler optimization.

Revision 1.47: download - view: text, markup, annotated - select for diffs
Thu Nov 18 10:20:45 1999 UTC (12 years, 2 months ago) by pb
Branches: MAIN
Diff to: previous 1.46: preferred, colored
Changes since revision 1.46: +10 -9 lines
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

Revision 1.46: download - view: text, markup, annotated - select for diffs
Mon Nov 15 20:04:53 1999 UTC (12 years, 2 months ago) by pb
Branches: MAIN
Diff to: previous 1.45: preferred, colored
Changes since revision 1.45: +10 -6 lines
Fix aliasing bug causing in_cksum() to fail on odd packet sizes
due to compiler optimization.

PR:		bin/13292
Suggested by:	wollman

Revision 1.8.2.18: download - view: text, markup, annotated - select for diffs
Sun Sep 5 11:24:09 1999 UTC (12 years, 5 months ago) by peter
Branches: RELENG_2_2
Diff to: previous 1.8.2.17: preferred, colored; branchpoint 1.8: preferred, colored; next MAIN 1.9: preferred, colored
Changes since revision 1.8.2.17: +1 -1 lines
$Id$ -> $FreeBSD$

Revision 1.42.2.2: download - view: text, markup, annotated - select for diffs
Sun Aug 29 15:15:07 1999 UTC (12 years, 5 months ago) by peter
Branches: RELENG_3
CVS tags: RELENG_3_3_0_RELEASE
Diff to: previous 1.42.2.1: preferred, colored; branchpoint 1.42: preferred, colored
Changes since revision 1.42.2.1: +1 -1 lines
$Id$ -> $FreeBSD$

Revision 1.45: download - view: text, markup, annotated - select for diffs
Sat Aug 28 00:13:59 1999 UTC (12 years, 5 months ago) by peter
Branches: MAIN
Diff to: previous 1.44: preferred, colored
Changes since revision 1.44: +1 -1 lines
$Id$ -> $FreeBSD$

Revision 1.42.2.1: download - view: text, markup, annotated - select for diffs
Sat May 8 15:42:42 1999 UTC (12 years, 9 months ago) by mckay
Branches: RELENG_3
CVS tags: RELENG_3_2_PAO_BP, RELENG_3_2_PAO, RELENG_3_2_0_RELEASE
Diff to: previous 1.42: preferred, colored
Changes since revision 1.42: +8 -5 lines
MFC: Flood ping fix, -l option fix, egcs warning fix, -S documentation.
Now equivalent to ping.c 1.44 and ping.8 1.20.

PR:	9308

Revision 1.44: download - view: text, markup, annotated - select for diffs
Fri May 7 14:38:48 1999 UTC (12 years, 9 months ago) by mckay
Branches: MAIN
Diff to: previous 1.43: preferred, colored
Changes since revision 1.43: +6 -4 lines
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

Revision 1.43: download - view: text, markup, annotated - select for diffs
Sun Apr 25 22:33:30 1999 UTC (12 years, 9 months ago) by imp
Branches: MAIN
Diff to: previous 1.42: preferred, colored
Changes since revision 1.42: +3 -2 lines
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

Revision 1.42: download - view: text, markup, annotated - select for diffs
Wed Jan 6 07:54:28 1999 UTC (13 years, 1 month ago) by imp
Branches: MAIN
CVS tags: RELENG_3_BP, RELENG_3_1_0_RELEASE
Branch point for: RELENG_3
Diff to: previous 1.41: preferred, colored
Changes since revision 1.41: +44 -11 lines
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

Revision 1.41: download - view: text, markup, annotated - select for diffs
Wed Aug 26 18:51:37 1998 UTC (13 years, 5 months ago) by des
Branches: MAIN
CVS tags: RELENG_3_0_0_RELEASE
Diff to: previous 1.40: preferred, colored
Changes since revision 1.40: +1 -13 lines
Remove -c restrictions from previous commit.

Revision 1.40: download - view: text, markup, annotated - select for diffs
Wed Aug 26 01:58:39 1998 UTC (13 years, 5 months ago) by dillon
Branches: MAIN
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +38 -11 lines
    (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.

Revision 1.8.2.17: download - view: text, markup, annotated - select for diffs
Fri Jul 17 20:13:45 1998 UTC (13 years, 6 months ago) by jkh
Branches: RELENG_2_2
CVS tags: RELENG_2_2_8_RELEASE, RELENG_2_2_7_RELEASE
Diff to: previous 1.8.2.16: preferred, colored; branchpoint 1.8: preferred, colored
Changes since revision 1.8.2.16: +59 -40 lines
MFC: gack.  That's the doc fixes merged, many utilities converted over
to err(), and a few assorted buffer overflow fixes.  Also nuked the
now-useless LFS stuff.

Revision 1.39: download - view: text, markup, annotated - select for diffs
Wed Jul 15 06:45:02 1998 UTC (13 years, 6 months ago) by charnier
Branches: MAIN
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +13 -20 lines
Correct use of .Nm. Remove unused #includes. Use warn(). cosmetic in usage()
string.
Translate 0 sec 1000000 usec to 1 sec 0 usec.

Revision 1.38: download - view: text, markup, annotated - select for diffs
Sat Jun 6 23:30:48 1998 UTC (13 years, 8 months ago) by jb
Branches: MAIN
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +6 -3 lines
Fix an alignment problem on alpha by doing a bytewise copy.

Revision 1.8.2.16: download - view: text, markup, annotated - select for diffs
Mon May 25 20:21:34 1998 UTC (13 years, 8 months ago) by fenner
Branches: RELENG_2_2
Diff to: previous 1.8.2.15: preferred, colored; branchpoint 1.8: preferred, colored
Changes since revision 1.8.2.15: +104 -81 lines
MFC: rev 1.37: use select(), SO_TIMESTAMP and fix IP options generation.

Revision 1.37: download - view: text, markup, annotated - select for diffs
Mon May 25 20:16:05 1998 UTC (13 years, 8 months ago) by fenner
Branches: MAIN
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +104 -81 lines
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

Revision 1.36: download - view: text, markup, annotated - select for diffs
Mon May 25 06:53:17 1998 UTC (13 years, 8 months ago) by steve
Branches: MAIN
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +9 -21 lines
Revert the previous fix.  As it turns out Warner Losh is
working a better fix.

Revision 1.35: download - view: text, markup, annotated - select for diffs
Mon May 25 03:50:51 1998 UTC (13 years, 8 months ago) by steve
Branches: MAIN
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +21 -9 lines
Attempt to stop another DoS attack related to ping flooding.

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

Revision 1.34: download - view: text, markup, annotated - select for diffs
Sat May 16 00:19:27 1998 UTC (13 years, 8 months ago) by jb
Branches: MAIN
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +27 -14 lines
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.

Revision 1.33: download - view: text, markup, annotated - select for diffs
Wed Apr 15 19:55:14 1998 UTC (13 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +2 -2 lines
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

Revision 1.32: download - view: text, markup, annotated - select for diffs
Thu Apr 2 04:33:18 1998 UTC (13 years, 10 months ago) by imp
Branches: MAIN
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +2 -1 lines
Add aback in a line a accidentally killed in my last commit.
Submitted by:	Bill Fenner

Revision 1.31: download - view: text, markup, annotated - select for diffs
Thu Apr 2 01:12:55 1998 UTC (13 years, 10 months ago) by eivind
Branches: MAIN
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +2 -2 lines
Make this compile (and seemingly work).

Revision 1.30: download - view: text, markup, annotated - select for diffs
Wed Apr 1 00:32:18 1998 UTC (13 years, 10 months ago) by imp
Branches: MAIN
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +13 -4 lines
A fairly rare possible buffer overflow:
	Theo fixed this and tqbf reported it
Obtained from: OpenBSD

Revision 1.8.2.15: download - view: text, markup, annotated - select for diffs
Fri Mar 6 13:07:12 1998 UTC (13 years, 11 months ago) by jkh
Branches: RELENG_2_2
CVS tags: RELENG_2_2_6_RELEASE
Diff to: previous 1.8.2.14: preferred, colored; branchpoint 1.8: preferred, colored
Changes since revision 1.8.2.14: +2 -2 lines
MFC: style nits & missing DPADD

Revision 1.29: download - view: text, markup, annotated - select for diffs
Wed Dec 24 00:59:02 1997 UTC (14 years, 1 month ago) by imp
Branches: MAIN
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +2 -2 lines
Minor style nit noticed by bde.

Revision 1.8.2.14: download - view: text, markup, annotated - select for diffs
Sun Sep 14 19:40:04 1997 UTC (14 years, 4 months ago) by jkh
Branches: RELENG_2_2
CVS tags: RELENG_2_2_5_RELEASE
Diff to: previous 1.8.2.13: preferred, colored; branchpoint 1.8: preferred, colored
Changes since revision 1.8.2.13: +241 -203 lines
MFC: doc changes and new preload features.

Revision 1.8.2.13: download - view: text, markup, annotated - select for diffs
Mon Aug 11 04:34:17 1997 UTC (14 years, 6 months ago) by fenner
Branches: RELENG_2_2
Diff to: previous 1.8.2.12: preferred, colored; branchpoint 1.8: preferred, colored
Changes since revision 1.8.2.12: +2 -2 lines
Merge from -current:
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)

Revision 1.28: download - view: text, markup, annotated - select for diffs
Mon Aug 11 04:33:07 1997 UTC (14 years, 6 months ago) by fenner
Branches: MAIN
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +3 -3 lines
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)

Revision 1.8.2.12: download - view: text, markup, annotated - select for diffs
Thu Aug 7 02:47:10 1997 UTC (14 years, 6 months ago) by julian
Branches: RELENG_2_2
Diff to: previous 1.8.2.11: preferred, colored; branchpoint 1.8: preferred, colored
Changes since revision 1.8.2.11: +4 -4 lines
MFC: make sure we count packets with errors (except ENOBUFS)
this makes -c work again for targets with no route to them.
matches version 1.27

Revision 1.27: download - view: text, markup, annotated - select for diffs
Thu Aug 7 02:41:15 1997 UTC (14 years, 6 months ago) by julian
Branches: MAIN
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +3 -3 lines
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..

Revision 1.26: download - view: text, markup, annotated - select for diffs
Sun Jul 20 06:09:55 1997 UTC (14 years, 6 months ago) by bde
Branches: MAIN
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +24 -21 lines
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).

Revision 1.25: download - view: text, markup, annotated - select for diffs
Fri Jul 18 17:52:05 1997 UTC (14 years, 6 months ago) by wollman
Branches: MAIN
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +12 -4 lines
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.

Revision 1.8.2.11: download - view: text, markup, annotated - select for diffs
Sun Jul 13 07:55:54 1997 UTC (14 years, 7 months ago) by sef
Branches: RELENG_2_2
Diff to: previous 1.8.2.10: preferred, colored; branchpoint 1.8: preferred, colored
Changes since revision 1.8.2.10: +37 -4 lines
Merge from current -- handle the case where we're trying to ping an
unreachable host better.

Revision 1.24: download - view: text, markup, annotated - select for diffs
Sun Jul 13 06:16:44 1997 UTC (14 years, 7 months ago) by sef
Branches: MAIN
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +28 -10 lines
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

Revision 1.8.2.10: download - view: text, markup, annotated - select for diffs
Wed Jul 9 20:38:38 1997 UTC (14 years, 7 months ago) by julian
Branches: RELENG_2_2
Diff to: previous 1.8.2.9: preferred, colored; branchpoint 1.8: preferred, colored
Changes since revision 1.8.2.9: +3 -1 lines
YAMFC
don't count packets that we weren't allowed to send in our
transmitted packets count.

Revision 1.23: download - view: text, markup, annotated - select for diffs
Wed Jul 9 20:33:58 1997 UTC (14 years, 7 months ago) by julian
Branches: MAIN
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +4 -2 lines
don't count packets as being transmitted when we know that the sendto()
failed (e.g. ENOBUFS)

Revision 1.8.2.9: download - view: text, markup, annotated - select for diffs
Wed Jul 9 19:43:19 1997 UTC (14 years, 7 months ago) by julian
Branches: RELENG_2_2
Diff to: previous 1.8.2.8: preferred, colored; branchpoint 1.8: preferred, colored
Changes since revision 1.8.2.8: +27 -6 lines
YAMFC
remove recursinve malloc (via printf in signal handler)
allow gracefull backof on ping -f on slow links
(usleep 2 ticks if we get ENOBUFS)

Revision 1.22: download - view: text, markup, annotated - select for diffs
Wed Jul 9 19:40:43 1997 UTC (14 years, 7 months ago) by julian
Branches: MAIN
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +26 -5 lines
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().

Revision 1.1.1.2 (vendor branch): download - view: text, markup, annotated - select for diffs
Wed Jul 2 00:24:02 1997 UTC (14 years, 7 months ago) by bde
Branches: CSRG
CVS tags: bsd_44_lite_2
Diff to: previous 1.1.1.1: preferred, colored
Changes since revision 1.1.1.1: +5 -5 lines
Import Lite2's src/sbin, except for XNSrouted and routed.  All relevant
files in src/sbin are off the vendor branch, so this doesn't change the
active versions.

Revision 1.21: download - view: text, markup, annotated - select for diffs
Tue Mar 4 22:05:49 1997 UTC (14 years, 11 months ago) by imp
Branches: MAIN
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +2 -2 lines
Fix typo introduced in 1.17.

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

Revision 1.20: download - view: text, markup, annotated - select for diffs
Mon Mar 3 09:50:21 1997 UTC (14 years, 11 months ago) by imp
Branches: MAIN
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +3 -1 lines
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.

Revision 1.8.2.8: download - view: text, markup, annotated - select for diffs
Mon Mar 3 09:44:16 1997 UTC (14 years, 11 months ago) by imp
Branches: RELENG_2_2
CVS tags: RELENG_2_2_2_RELEASE, RELENG_2_2_1_RELEASE, RELENG_2_2_0_RELEASE
Diff to: previous 1.8.2.7: preferred, colored; branchpoint 1.8: preferred, colored
Changes since revision 1.8.2.7: +12 -3 lines
Backport changes from current:
 1) getopt returnes -1 and remove 'h:' that isn't needed
 2) -l needs super user now to work
 3) check to make sure that address returned from gethostbyname will fit in
    sin_addr
 4) Fix minor strncpy bug.
 5) Don't leak information about ICMP packets that aren't for you, unless
    superuser.

Revision 1.19: download - view: text, markup, annotated - select for diffs
Sun Mar 2 20:01:13 1997 UTC (14 years, 11 months ago) by imp
Branches: MAIN
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +5 -3 lines
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

Revision 1.18: download - view: text, markup, annotated - select for diffs
Sun Mar 2 06:32:40 1997 UTC (14 years, 11 months ago) by imp
Branches: MAIN
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +17 -6 lines
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).

Revision 1.17: download - view: text, markup, annotated - select for diffs
Sat Mar 1 20:19:18 1997 UTC (14 years, 11 months ago) by wollman
Branches: MAIN
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +182 -160 lines
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.

Revision 1.8.2.7: download - view: text, markup, annotated - select for diffs
Mon Feb 24 04:14:58 1997 UTC (14 years, 11 months ago) by fenner
Branches: RELENG_2_2
Diff to: previous 1.8.2.6: preferred, colored; branchpoint 1.8: preferred, colored
Changes since revision 1.8.2.6: +62 -13 lines
Merge multicast additions (ping.c rev 1.15, ping.8 rev 1.4) from current.

Ok'd by:	jkh

Revision 1.8.2.6: download - view: text, markup, annotated - select for diffs
Sat Feb 8 04:11:36 1997 UTC (15 years ago) by danny
Branches: RELENG_2_2
Diff to: previous 1.8.2.5: preferred, colored; branchpoint 1.8: preferred, colored
Changes since revision 1.8.2.5: +41 -98 lines
Reviewed by:	Gary jennejohn
Submitted by:	Bruce Murphy <packrat@iinet.net.au>

Add '-a' audible flag to 2.2, and fix up earlier confusion.

Revision 1.16: download - view: text, markup, annotated - select for diffs
Sat Feb 8 01:43:56 1997 UTC (15 years ago) by danny
Branches: MAIN
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +8 -2 lines
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.

Revision 1.8.2.5: download - view: text, markup, annotated - select for diffs
Sat Feb 8 01:33:34 1997 UTC (15 years ago) by danny
Branches: RELENG_2_2
Diff to: previous 1.8.2.4: preferred, colored; branchpoint 1.8: preferred, colored
Changes since revision 1.8.2.4: +98 -41 lines
Back out the 'audible' changes which went to the wrong branch.

Revision 1.8.2.4: download - view: text, markup, annotated - select for diffs
Thu Feb 6 22:48:25 1997 UTC (15 years ago) by danny
Branches: RELENG_2_2
Diff to: previous 1.8.2.3: preferred, colored; branchpoint 1.8: preferred, colored
Changes since revision 1.8.2.3: +8 -2 lines
Reviewed by:	Gary Jennejohn
Submitted by:	Bruce Murphy <packrat@iinet.net.au>
Modified files:
	ping.c
Add the '-a' audible flag to ping, useful for debugging ethernets
without requiring the operator to jump up and look at the ping results
every 15 seconds.

Revision 1.15: download - view: text, markup, annotated - select for diffs
Sun Dec 15 23:41:29 1996 UTC (15 years, 1 month ago) by fenner
Branches: MAIN
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +61 -12 lines
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

Revision 1.14: download - view: text, markup, annotated - select for diffs
Tue Dec 10 14:41:22 1996 UTC (15 years, 2 months ago) by bde
Branches: MAIN
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +19 -24 lines
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

Revision 1.13: download - view: text, markup, annotated - select for diffs
Sun Dec 8 06:27:09 1996 UTC (15 years, 2 months ago) by pst
Branches: MAIN
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +1 -1 lines
Fix typo in last patch. empty!=emtpy

Revision 1.12: download - view: text, markup, annotated - select for diffs
Sat Dec 7 20:20:41 1996 UTC (15 years, 2 months ago) by sef
Branches: MAIN
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +34 -15 lines
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

Revision 1.8.2.3: download - view: text, markup, annotated - select for diffs
Tue Dec 3 15:41:13 1996 UTC (15 years, 2 months ago) by phk
Branches: RELENG_2_2
Diff to: previous 1.8.2.2: preferred, colored; branchpoint 1.8: preferred, colored
Changes since revision 1.8.2.2: +2 -2 lines
YAMFC

Revision 1.11: download - view: text, markup, annotated - select for diffs
Mon Dec 2 21:42:11 1996 UTC (15 years, 2 months ago) by fenner
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +2 -2 lines
Fix math in SIGINFO printer.

Revision 1.8.2.2: download - view: text, markup, annotated - select for diffs
Thu Nov 21 16:37:23 1996 UTC (15 years, 2 months ago) by phk
Branches: RELENG_2_2
Diff to: previous 1.8.2.1: preferred, colored; branchpoint 1.8: preferred, colored
Changes since revision 1.8.2.1: +6 -5 lines
YAMFC

Revision 1.10: download - view: text, markup, annotated - select for diffs
Tue Nov 19 03:32:32 1996 UTC (15 years, 2 months ago) by sef
Branches: MAIN
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +6 -5 lines
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

Revision 1.8.2.1: download - view: text, markup, annotated - select for diffs
Tue Nov 5 20:08:25 1996 UTC (15 years, 3 months ago) by phk
Branches: RELENG_2_2
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +4 -4 lines
Merge from -current.

Revision 1.9: download - view: text, markup, annotated - select for diffs
Mon Nov 4 17:25:03 1996 UTC (15 years, 3 months ago) by bde
Branches: MAIN
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +4 -4 lines
Fixed backgrounding of ping, which was broken by the ^T changes in rev.1.3.

Revision 1.8: download - view: text, markup, annotated - select for diffs
Tue Aug 20 23:50:15 1996 UTC (15 years, 5 months ago) by fenner
Branches: MAIN
CVS tags: RELENG_2_2_BP
Branch point for: RELENG_2_2
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +50 -19 lines
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).

Revision 1.7: download - view: text, markup, annotated - select for diffs
Fri Aug 9 06:00:15 1996 UTC (15 years, 6 months ago) by fenner
Branches: MAIN
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +17 -3 lines
Drop setuid ASAP, to minimize code executed as root.

Reviewed by:	pst

Revision 1.6: download - view: text, markup, annotated - select for diffs
Sun Jul 28 20:29:10 1996 UTC (15 years, 6 months ago) by peter
Branches: MAIN
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +3 -2 lines
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)

Revision 1.5: download - view: text, markup, annotated - select for diffs
Tue May 30 06:09:37 1995 UTC (16 years, 8 months ago) by rgrimes
Branches: MAIN
CVS tags: RELENG_2_1_7_RELEASE, RELENG_2_1_6_RELEASE, RELENG_2_1_6_1_RELEASE, RELENG_2_1_5_RELEASE, RELENG_2_1_0_RELEASE, RELENG_2_1_0_BP, RELENG_2_1_0, RELENG_2_0_5_RELEASE, RELENG_2_0_5_BP, RELENG_2_0_5
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +3 -3 lines
Remove trailing whitespace.

Revision 1.4: download - view: text, markup, annotated - select for diffs
Tue Nov 29 16:09:56 1994 UTC (17 years, 2 months ago) by davidg
Branches: MAIN
CVS tags: RELENG_2_0_5_ALPHA
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +4 -1 lines
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

Revision 1.3: download - view: text, markup, annotated - select for diffs
Sat Oct 22 17:30:35 1994 UTC (17 years, 3 months ago) by sef
Branches: MAIN
CVS tags: RELEASE_2_0, BETA_2_0, ALPHA_2_0
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +41 -1 lines
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. ;)

Revision 1.2: download - view: text, markup, annotated - select for diffs
Fri Aug 5 10:34:19 1994 UTC (17 years, 6 months ago) by davidg
Branches: MAIN
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +2 -2 lines
Changed output formatting to accurately represent the precision.

Revision 1.1.1.1 (vendor branch): download - view: text, markup, annotated - select for diffs
Thu May 26 06:34:49 1994 UTC (17 years, 8 months ago) by rgrimes
Branches: CSRG
CVS tags: bsd_44_lite
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +0 -0 lines
BSD 4.4 Lite sbin Sources

Note:  XNSrouted and routed NOT imported here, they shall be imported with
usr.sbin.

Revision 1.1: download - view: text, markup, annotated - select for diffs
Thu May 26 06:34:48 1994 UTC (17 years, 8 months ago) by rgrimes
Branches: MAIN
Initial revision

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options