Commit Graph

97 Commits

Author SHA1 Message Date
Denis Vlasenko
c8e9993514 ping: reuse another bit of common code. -60 bytes 2007-02-09 18:14:42 +00:00
Denis Vlasenko
9ca26d38c5 ping: support -I addr in family neutral manner; reuse a bit of common code 2007-02-09 17:32:16 +00:00
Denis Vlasenko
42823d597a add x to IPv6 functions which can die 2007-02-04 02:39:08 +00:00
Denis Vlasenko
06af216528 suppress warnings about easch <applet>_main() having
no preceding prototype
2007-02-03 17:28:39 +00:00
Denis Vlasenko
4c97863109 assorted fixes for bugs found with randomconfig 2007-02-03 03:31:13 +00:00
Denis Vlasenko
89ef65f024 preparatory patch for -Wwrite-strings #5 2007-01-29 23:43:18 +00:00
Denis Vlasenko
e935602ff5 taskset: fix incorrect rage spec and allow 0xXXX input
ping: shave off 60 bytes
2007-01-29 18:03:54 +00:00
Denis Vlasenko
aeb4bdd582 accidentally applied wrong (old) patch, fixing up... 2007-01-25 00:00:02 +00:00
Denis Vlasenko
581930cc0d opt_complementary doesn't like numeric opts :( 2007-01-24 23:55:34 +00:00
Denis Vlasenko
b9a279ba94 Unify ping and ping6. ping has -4 and -6 which force
name resolution into IP or IPv6 only, otherwise
we take address family returned by host2sockaddr()
in lsa->sa.sa_family. IOW: "ping ::1" with do IPv6 ping,
"ping 127.0.0.1" will do IPv4 ping.
ping6 is aliased to "ping -6".
2007-01-24 23:53:22 +00:00
Denis Vlasenko
9adc6ced4f ping6: stop using xgethostbyname2, remove it from libbb. 2007-01-22 22:45:27 +00:00
Denis Vlasenko
703e20235a cleanups: unnecessary casts, unified const_1, eliminate cross-.c file
prototypes (heresy!), add spaces in places like "flags&NETSTAT_CONNECTED",
removed unused #defines, #ifdef -> #if, use uint32_t for ipv4 addrs.
2007-01-22 14:12:08 +00:00
Denis Vlasenko
35d4da0fb5 exterminate u_intXXX.
fix ping6 buglet (memset is too short), minor sync between ping and ping6
2007-01-22 14:04:27 +00:00
Denis Vlasenko
3821fb13ea fix verbose output; remove commented-out includes. 2007-01-11 16:51:21 +00:00
Denis Vlasenko
44c2eb23dd ping6: fix sequence numbers (missed ntoh) and ttl display.
(apparently some, eh, clever libc guy decided that
*CHANGING* IPV6_HOPLIMIT value in libc header is a nifty idea...)
2007-01-08 23:55:33 +00:00
Denis Vlasenko
919c10dd88 ping[6]: don't do htons(a++), it can be a macro 2007-01-03 22:14:18 +00:00
Denis Vlasenko
806116b234 fixes from Yann E. MORIN <yann.morin.1998@anciens.enib.fr> 2006-12-31 12:14:16 +00:00
Denis Vlasenko
d9e15f2068 style cleanup: return(a) -> return a, part 2 2006-11-27 16:49:55 +00:00
Denis Vlasenko
48237b0c88 introduce setsockopt_reuseaddr(int fd), setsockopt_broadcast(int fd),
use them where appropriate. 200 bytes saved
2006-11-22 23:22:06 +00:00
Denis Vlasenko
4a5cf16a36 login: use %s - we know that string is not too long there
ping[6]: use getopt32: smaller (-50 bytes) and handles -c6 correctly
(was requiring '-c 6' with mandatory space)
2006-11-20 00:48:22 +00:00
Denis Vlasenko
c6f188def8 silly size savings and capitalization fixes 2006-10-26 00:37:00 +00:00
Denis Vlasenko
e1a0d486e4 message string changes, mostly for consistency, also -32 bytes in .rodata 2006-10-20 13:28:22 +00:00
Denis Vlasenko
1385899416 attempt to regularize atoi mess. 2006-10-08 12:49:22 +00:00
Denis Vlasenko
bcf4908e71 ping: bind -> xbind 2006-09-02 17:53:16 +00:00
Denis Vlasenko
e0b7f71d26 ping(6): use htons instead of SWAP_BE. 2006-09-02 16:57:59 +00:00
Denis Vlasenko
2cbe6e6eb2 ping: implement -I option 2006-09-02 16:17:30 +00:00
Denis Vlasenko
db7f2e5881 ping6: resolve interface name to number early.
gcc is more efficient at truncating int to int16
via cast, use that instead of &.
2006-09-02 16:16:23 +00:00
Denis Vlasenko
cb6874cc66 Sync ping and ping6 a bit, fix style and indentation. 2006-09-02 16:13:36 +00:00
Rob Landley
cae61e7ca4 Make a gcc 4.1 warning go away. 2006-08-01 00:30:26 +00:00
Rob Landley
9b1857f79f Bugfix from Shaun Jackman: don't attempt to write 64 bytes and then fail if
the write wasn't 192 bytes long.
2006-05-31 23:54:50 +00:00
Rob Landley
299a6b4d7b Consolidate #include <sys/time.h> so libbb.h does it. 2006-05-27 21:42:58 +00:00
Rob Landley
07a637df47 Patch from KRONSTORFER Horst to Fix a size mismatch in ping, such as the 56/84
mismatch inthe following example:
  # ping -c 1 172.16.2.1
  PING 172.16.2.1 (172.16.2.1): 56 data bytes
  84 bytes from 172.16.2.1: icmp_seq=0 ttl=64 time=0.2 ms
2006-04-01 17:28:11 +00:00
Mike Frysinger
06adf5fb47 2006-03-21 Shaun Jackman <sjackman@gmail.com>: Include signal.h instead of sys/signal.h. 2006-03-22 00:25:07 +00:00
Rob Landley
bc68cd14cc Patch from Denis Vlasenko turning static const int (which gets emitted into
the busybox binary) into enums (which don't).
2006-03-10 19:22:06 +00:00
Rob Landley
dfba741457 Robert P. Day removed 8 gazillion occurrences of "extern" on function
definitions.  (That should only be on prototypes.)
2006-03-06 20:47:33 +00:00
Tim Riker
c1ef7bdd8d just whitespace 2006-01-25 00:08:53 +00:00
Rob Landley
bbf4e167f2 Ok, ping needs a rewrite from the ground up. (This is not a busybox app.)
Fix bug 309, where ping -s 1 localhost would give an elapsed time 9 digits
long due to a stack overflow.  Apparently, iputils also does this.
2006-01-11 03:44:11 +00:00
Rob Landley
42eddbafe7 Add a fflush(stdout). 2005-12-15 08:04:17 +00:00
Mike Frysinger
887a1ad57f BsAtHome writes in Bug 433:
Ping packets sent by busybox have wrong endian on f.x. mips32 (openwrt). Attatched is a patch that 
uses htons() and ntohs() to be platform independent.
2005-09-15 01:32:48 +00:00
Mike Frysinger
03e827a422 2005-03-19 Shaun Jackman <sjackman@gmail.com>
* networking/ping.c (ping): Change the type of fromlen to socklen_t.
2005-07-26 23:00:59 +00:00
Eric Andersen
14f5c8d764 Patch from Bernhard Fischer to make a bunch of symbols static
which were otherwise cluttering the global namespace.
2005-04-16 19:39:00 +00:00
Eric Andersen
c7bda1ce65 Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
Eric Andersen
85e5e72bc1 Remove remaining libc5 support code 2003-07-22 08:56:55 +00:00
Manuel Novoa III
cad5364599 Major coreutils update. 2003-03-19 09:13:01 +00:00
Eric Andersen
4e486a5d00 Kiss Gabor noticed that ping compiled without BB_FEATURE_FANCY_PING
would return 0 instead of EXIT_FAILURE when no response was received.
2003-01-12 06:08:33 +00:00
Eric Andersen
e90e741b1e Per discussion with vodz, Tim's changes do not seem to make sense.
Revert them.
 -Erik
2002-06-06 11:47:00 +00:00
Tim Riker
c6def44cfc ping return 1 if can't ping 2002-05-18 09:16:04 +00:00
Eric Andersen
b88868276c Doh! I broke ping when removing the nested function.
This patch from vodz fixes it again.
2002-03-21 14:04:43 +00:00
Eric Andersen
b5474c48b1 Cave to pressure (2 months later). Eliminate using a
nested function, which is a purely unremovable gcc-ism...
 -Erik
2002-03-20 11:59:28 +00:00
Matt Kraai
369da77d5e 2002-01-30 Neal H Walfield <neal@cs.uml.edu>
* networking/ping.c (hostname): Removed.

        [CONFIG_FEATURE_FANCY_PING] (noresp): Moved from here . . .
        [CONFIG_FEATURE_FANCY_PING] (ping:noresp): . . . to here.
        Use H->h_name, not hostname.
        [CONFIG_FEATURE_FANCY_PING] (ping): Do not copy H->h_name into
        hostname.
        Use H->h_name directly.

        [!CONFIG_FEATURE_FANCY_PING] (hostent): New global variable.
        [!CONFIG_FEATURE_FANCY_PING] (pingstats): Use hostent in favor
        of the now obsolete hostname global variable.
        [!CONFIG_FEATURE_FANCY_PING] (ping): Likewise.
        No need to copy H; use hostent instead.

        [!CONFIG_FEATURE_FANCY_PING] (ntransmitted, nreceived,
        nrepeats, pingcount, myid, options, tmax, tsum): Removed
        superfluous zero initializers.
2002-02-01 16:54:00 +00:00