Commit Graph

106 Commits

Author SHA1 Message Date
Denis Vlasenko
3483e85f6b ping: fix non-fancy ping6 2007-07-02 15:47:52 +00:00
Denis Vlasenko
5ad1048c3d ping: fix incorrect handling of -I (Iouri Kharon <bc-info@styx.cabel.net>) 2007-06-19 22:54:21 +00:00
Denis Vlasenko
7679145cfa ping: fix write-after-allocated-mem bug
ping: use monotonic_us instead of gettimeofday: smaller code and
      needs only 4 bytes in the packet
ping: display roundtrip times with 1/1000th of ms, not 1/10 ms precision.
wget: small optimization

function                                             old     new   delta
pingstats                                            243     259     +16
sendping6                                             98      93      -5
sendping4                                            183     178      -5
.rodata                                           129715  129707      -8
progressmeter                                        867     855     -12
unpack_tail                                          320     272     -48
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/5 up/down: 16/-78)            Total: -62 bytes
2007-06-18 08:55:57 +00:00
Denis Vlasenko
7b72fc1200 pscan: new applet (portscanner). ~1350 bytes. By Tito <farmatito@tiscali.it>
wget: lift 256 chars limitation on terminal width
2007-06-16 13:37:59 +00:00
Denis Vlasenko
821cc25f43 ping: stop using data/bss
function                                             old     new   delta
ping_main                                            375     392     +17
unpack_tail                                          317     320      +3
ping4                                                525     528      +3
ping6                                                772     773      +1
sendping6                                             99      98      -1
sendping4                                            184     183      -1
myid                                                   2       -      -2
sendping_tail                                        154     151      -3
tsum                                                   4       -      -4
tmin                                                   4       -      -4
tmax                                                   4       -      -4
source_lsa                                             4       -      -4
pingsock                                               4       -      -4
pingcount                                              4       -      -4
ntransmitted                                           4       -      -4
nrepeats                                               4       -      -4
nreceived                                              4       -      -4
if_index                                               4       -      -4
hostname                                               8       4      -4
dotted                                                 4       -      -4
datalen                                                4       -      -4
pingaddr                                              28       -     -28
rcvd_tbl                                             128       -    -128
------------------------------------------------------------------------------
(add/remove: 0/15 grow/shrink: 4/4 up/down: 24/-215)         Total: -191 bytes
   text    data     bss     dec     hex filename
 679835    2728   16736  699299   aaba3 busybox_old
 679851    2720   16536  699107   aaae3 busybox_unstripped
2007-06-04 10:33:48 +00:00
Denis Vlasenko
1c9ad62d26 ping: fix wrong sign extension of packet id (bug 1373) 2007-05-27 00:53:41 +00:00
Denis Vlasenko
b6adbf1be2 usage.c: remove reference to busybox.h
*: s/include "busybox.h"/include "libbb.h"
2007-05-26 19:00:18 +00:00
Bernhard Reutner-Fischer
b290889f02 - add xsendto and use where appropriate; shrink iplink; sanitize libiproute a bit.
-916 byte
2007-04-12 11:34:39 +00:00
Denis Vlasenko
19c238bc90 ping: don't measure times if ping payload is less than 8 bytes;
commonalize some ping code.
2007-03-03 00:36:35 +00:00
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