summaryrefslogtreecommitdiffstats
path: root/sbin/ping/ping.c
Commit message (Collapse)AuthorAgeFilesLines
* Small style fixes:ed2010-06-201-32/+16
| | | | | | - ANSIfy prototypes. - Remove unneeded whitespace. - Add const keyword to function where it can be used.
* Commit IPv6 support for FAST_IPSEC to the tree.gnn2007-07-011-1/+1
| | | | | | | | This commit includes all remaining changes for the time being including user space updates. Submitted by: bz Approved by: re
* Force the alignment of the chars arrays, as they are casted later tocognet2007-05-211-1/+1
| | | | | | structs. gcc 4.2 doesn't do it by default, and that results in unaligned access on arm.
* Print packet loss figures with one decimal place. ping6 already doesdd2006-08-141-4/+4
| | | | | this, and OpenBSD and NetBSD pings do it too. This is primarily useful for comparing low levels of packet loss.
* Add a new feature to ping(8) - possibility to specify maximumglebius2006-04-051-7/+28
| | | | | | | | | | 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>
* Sync usage() with SYNOPSIS.ru2005-12-011-4/+4
|
* Implement a new feature for ping(8) - sweeping pings. In a sweepingglebius2005-08-151-6/+93
| | | | | | | | | 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)
* o Store timestamp in network byte order.maxim2004-09-301-4/+15
| | | | | | | | | 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
* Avoid using void pointers in additive expressions.stefanf2004-08-141-1/+1
| | | | PR: 56653
* Remove advertising clause from University of California Regent's license,markm2004-04-091-4/+0
| | | | | | per letter dated July 22, 1999. Approved by: core, imp
* Don't turn off the regular SIGINFO status information. The use ofiedowse2004-04-071-14/+0
| | | | | | | | | | 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
* Certain ICMP error replies cause ping to perform a reverse DNSiedowse2004-02-081-0/+6
| | | | | | | | | | | 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
* o Rename local variables, do not shadow global declarations.maxim2003-07-141-7/+7
|
* o Kill MINICMPLEN, there is ICMP_MINLEN already.maxim2003-07-141-7/+6
|
* o Be ready to get a reply with length up to IP_MAXPACKET.maxim2003-07-141-11/+18
| | | | | | | | 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
* Fix SIGINFO handling: do not print incorrect timing statisticsmaxim2003-06-021-6/+6
| | | | | | when the data for it is not available. Founded by: ping -s0 localhost; press ^T
* Use __FBSDID() to quiet GCC 3.3 warnings.obrien2003-05-031-4/+4
|
* o Skip timestamp part when checking payload.maxim2003-04-141-2/+8
| | | | | PR: bin/50909 Submitted by: Barney Wolff <barney@lab.databus.com>
* Deal with a case where the returned packed was smaller than themdodd2003-04-071-12/+17
| | | | | | transmitted packet (because the remote host stripped off our icmp_data). Submitted by: Maxim Konovalov <maxim@macomnet.ru>
* Back out support for RFC3514.mdodd2003-04-021-13/+1
| | | | RFC3514 poses an unacceptale risk to compliant systems.
* IP_EVIL -> IP_EFmaxim2003-04-021-2/+2
|
* Implement support for RFC 3514 (The Security Flag in the IPv4 Header).mdodd2003-04-011-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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.
* Default data length should be 56, not 64.mdodd2003-03-281-1/+1
|
* - Make -M mask and -M time exclusive.mdodd2003-03-241-22/+21
| | | | | | | | | | | | | | | | | | | | - 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>
* Fixed an errx format error in rev.1.81. This should have been fatalbde2003-03-241-2/+2
| | | | | | | | 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).
* Demangle the usage message at the source level.ru2003-03-141-15/+8
| | | | Submitted by: bde
* Fix and sync SYNOPSIS and usage().ru2003-03-111-12/+12
| | | | Prodded by: bde
* Update ping to be WARNS=2 compliant.seanc2003-03-051-26/+35
| | | | | Reviewed by: -audit (no objections ~1mo) Approved by: nectar
* Support ICMP_TSTAMP/ICMP_TSTAMPREPLY.mdodd2003-03-021-28/+94
| | | | This alters the meaning of the '-M' flag.
* Sort options.ru2003-02-231-40/+40
|
* Call fill() after maxpayload has been initialized.mdodd2003-01-291-3/+6
| | | | Reviewed by: maxim
* Send ICMP_MASKREQ packets when the '-M' option is specified.mdodd2003-01-281-6/+22
|
* Better error handling for -s.maxim2003-01-231-10/+14
| | | | | | | | | | | | | | 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
* style(9) sweep.maxim2003-01-231-37/+30
| | | | Submitted by: bde
* Anti-magic: s/255/MAXTTL/maxim2003-01-231-2/+2
|
* Implement -D (do not fragment) and -z (TOS) options.maxim2003-01-231-7/+57
| | | | | | PR: bin/29164 Reviewed by: silence of -net Obtained from: OpenBSD
* Print strict source routing option.maxim2003-01-231-1/+3
| | | | | Reviewed by: silence on -net Proposed by: David Wang <dsw@juniper.net>
* Fix LSRR option length check: it has to be less or equal remained header'smaxim2002-10-211-1/+2
| | | | | | length minus sizeof(struct ip). MFC after: 1 week
* Add an -o option to exit after receiving one reply. This can be useddd2002-10-021-3/+8
| | | | | | | | to test whether a link is live. PR: 38573 Submitted by: David Taylor <davidt@yadt.co.uk> Obtained from: NetBSD
* Commit "unrelated style fixes" part of Bruce's patch (regardingpeter2002-09-111-5/+5
| | | | | | bcopy/memcpy) seperately. Submitted by: bde
* Modify previous commit to solve the real problem that made gcc thinkpeter2002-09-111-5/+5
| | | | | | | 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
* In reference to previous commit: use err(3).nectar2002-09-091-4/+2
| | | | Noticed by: bde
* Check for FD_SET overrun.nectar2002-09-091-0/+4
|
* Add the -A flag to the usage line.iedowse2002-08-271-1/+1
| | | | | Submitted by: Yutaka KAWASE <yutaka@mailhost.net> MFC after: 3 days
* Fix the broken "avoid unaligned data" fix. The problem is that the builtinpeter2002-08-101-2/+2
| | | | | | | | | | | | | | | | | | 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.
* o Change almost all magic numbers to the appropriate constants.maxim2002-07-051-28/+32
| | | | | | | | | 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
* More strict ip options parsing.maxim2002-07-051-53/+44
| | | | | Reviewed by: bde (style), silence on -audit MFC after: 2 months
* WARNS fixes.maxim2002-04-021-3/+3
| | | | | | | Submitted by: kris Reviewed by: bde Approved by: ru MFC after: 2 weeks
* style(9) cleanup.maxim2002-04-021-57/+53
| | | | | | | Submitted by: kris (an early version of this patch) Reviewed by: bde Approved by: ru MFC after: 2 weeks
* Style(9) local vars after 'register' removal.obrien2002-03-231-33/+41
| | | | Requested by: bde
OpenPOWER on IntegriCloud