summaryrefslogtreecommitdiffstats
path: root/sbin/ping
Commit message (Collapse)AuthorAgeFilesLines
* Fix an alignment problem on alpha by doing a bytewise copy.jb1998-06-061-3/+6
|
* Use select() timeouts instead of SIGALRM to schedule packet transmission.fenner1998-05-251-81/+104
| | | | | | | | | | 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
* Revert the previous fix. As it turns out Warner Losh issteve1998-05-251-21/+9
| | | | working a better fix.
* Attempt to stop another DoS attack related to ping flooding.steve1998-05-251-9/+21
| | | | | PR: 6649 Submitted by: Jason Young <doogie@forbidden-donut.anet-stl.com>
* When a timeval is stored at the beginning of icmp_data, the fieldsjb1998-05-161-14/+27
| | | | | | | | | | | 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.
* If ping write fails with short packet count, thephk1998-04-151-2/+2
| | | | | | | error message prints the two numbers backwards. PR: 6313 Reviewed by: phk Submitted by: Archie Cobbs
* Add aback in a line a accidentally killed in my last commit.imp1998-04-021-1/+2
| | | | Submitted by: Bill Fenner
* Make this compile (and seemingly work).eivind1998-04-021-2/+2
|
* A fairly rare possible buffer overflow:imp1998-04-012-5/+17
| | | | | Theo fixed this and tqbf reported it Obtained from: OpenBSD
* .Sh AUTHOR -> .Sh AUTHORS. Use .An/.Aq.charnier1998-03-191-2/+4
|
* Minor style nit noticed by bde.imp1997-12-241-2/+2
|
* Fixed DPADD.bde1997-12-161-0/+2
|
* Add an ntohs() and format an IP address with inet_ntoa() whenfenner1997-08-111-3/+3
| | | | | | | printing the details of a received ICMP packet. PR: bin/3766 Submitted by: denny1@home.com (Denton Gentry)
* don't lose track of how many packets we've sentjulian1997-08-071-3/+3
| | | | | | 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..
* Cleaned up revisions 1.22 and 1.23.bde1997-07-201-21/+24
| | | | | Fixed minor bugs in revisions 1.12 and 1.23 (variables assigned to in signal handlers weren't declared as volatile).
* Calculate and print out the standard deviation of the round trip times.wollman1997-07-183-19/+33
| | | | | | | 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.
* Fix a problem introduced with a recent change that caused a hang withsef1997-07-131-10/+28
| | | | | | | | | 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
* don't count packets as being transmitted when we know that the sendto()julian1997-07-091-2/+4
| | | | failed (e.g. ENOBUFS)
* ping called printf() from a signal handler..julian1997-07-091-5/+26
| | | | | | | | | | 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().
* Fix typo introduced in 1.17.imp1997-03-041-2/+2
| | | | Submitted by: "Philippe Charnier" <charnier@xp11.frmug.org>
* Check the size of the IP address reutrned from gethostbyname2, per PRimp1997-03-031-1/+3
| | | | | | 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.
* fix man page to use marcos instead of parens, quotes and bracesjmg1997-03-021-60/+79
| | | | plus other minor fixes
* 1) Minor nits in the usage message from bde. I took out the hard tabs andimp1997-03-022-4/+7
| | | | | | | | | 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
* 1) Fix usage to match convention and manual. Fix manual to match usage.imp1997-03-022-10/+26
| | | | | | | | | | | | | 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).
* Make ping -Wall clean (except for one warning).wollman1997-03-013-174/+219
| | | | | | | | | 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.
* Revert $FreeBSD$ to $Id$peter1997-02-221-1/+1
|
* Reviewed by: Gary Jennejohn <gj@freebsd.org>danny1997-02-082-3/+12
| | | | | | | 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.
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | 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.
* Add multicast options -I (source interface), -T (set ttl), -L (no loopback).fenner1996-12-152-15/+80
| | | | | | | 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
* Cleaned up recent SIGINFO changes.bde1996-12-101-24/+19
| | | | | | | | | | | | 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
* Fix typo in last patch. empty!=emtpypst1996-12-081-1/+1
|
* Change how SIGINFO is handled -- set a flag (of sig_atomic_t), and checksef1996-12-071-15/+34
| | | | | | | that flag on every iteration of the loop. This avoids calling fprintf inside a signal handler, which is always somewhat icky. Reviewed by: bde
* Fix math in SIGINFO printer.fenner1996-12-021-2/+2
|
* Move the terminal handling code to a later location; this allowssef1996-11-191-5/+6
| | | | | | | 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
* Fixed backgrounding of ping, which was broken by the ^T changes in rev.1.3.bde1996-11-041-4/+4
|
* delete doubled words, e.g.: "the the" -> "the"wosch1996-10-051-1/+2
|
* Print out ICMP errors that are responses to our own packets by default.fenner1996-08-202-20/+69
| | | | | | | | 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).
* Drop setuid ASAP, to minimize code executed as root.fenner1996-08-091-3/+17
| | | | Reviewed by: pst
* Limit the risk of `buf' overrun in ping.c when printing hostnames.peter1996-07-281-2/+3
| | | | | | | | | 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)
* Remove trailing whitespace.rgrimes1995-05-301-3/+3
|
* In past releases of FreeBSD, I have used the exit status of "ping" todg1994-11-291-1/+4
| | | | | | | | | | | | 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
* Reviewed by: jkhsef1994-10-221-1/+41
| | | | | | 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. ;)
* Changed output formatting to accurately represent the precision.dg1994-08-051-2/+2
|
* Convert to our man installation style. Also fixed long-standing bugwollman1994-08-051-1/+1
| | | | | in `fastboot'/`fasthalt' in which the interpreter would hang around after `reboot' or `halt' is run, causing an irritating ``Killed'' message.
* BSD 4.4 Lite sbin Sourcesrgrimes1994-05-263-0/+1321
Note: XNSrouted and routed NOT imported here, they shall be imported with usr.sbin.
OpenPOWER on IntegriCloud