aboutsummaryrefslogtreecommitdiff
path: root/ping.c
diff options
context:
space:
mode:
Diffstat (limited to 'ping.c')
-rw-r--r--ping.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/ping.c b/ping.c
index 8276dda4b..f5769b74e 100644
--- a/ping.c
+++ b/ping.c
@@ -1,6 +1,6 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * $Id: ping.c,v 1.31 2001/01/22 22:48:42 andersen Exp $ 3 * $Id: ping.c,v 1.32 2001/01/23 22:30:04 markw Exp $
4 * Mini ping implementation for busybox 4 * Mini ping implementation for busybox
5 * 5 *
6 * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> 6 * Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
@@ -58,7 +58,7 @@
58#if ! defined __GLIBC__ && ! defined __UCLIBC__ 58#if ! defined __GLIBC__ && ! defined __UCLIBC__
59typedef unsigned int socklen_t; 59typedef unsigned int socklen_t;
60 60
61#define ICMP_MINLEN 8 /* abs minimum */ 61static const int ICMP_MINLEN = 8; /* abs minimum */
62 62
63struct icmp_ra_addr 63struct icmp_ra_addr
64{ 64{
@@ -134,13 +134,13 @@ struct icmp
134}; 134};
135#endif 135#endif
136 136
137#define DEFDATALEN 56 137static const int DEFDATALEN = 56;
138#define MAXIPLEN 60 138static const int MAXIPLEN = 60;
139#define MAXICMPLEN 76 139static const int MAXICMPLEN = 76;
140#define MAXPACKET 65468 140static const int MAXPACKET = 65468;
141#define MAX_DUP_CHK (8 * 128) 141#define MAX_DUP_CHK (8 * 128)
142#define MAXWAIT 10 142static const int MAXWAIT = 10;
143#define PINGINTERVAL 1 /* second */ 143static const int PINGINTERVAL = 1; /* second */
144 144
145#define O_QUIET (1 << 0) 145#define O_QUIET (1 << 0)
146 146
@@ -262,7 +262,7 @@ extern int ping_main(int argc, char **argv)
262static char *hostname = NULL; 262static char *hostname = NULL;
263static struct sockaddr_in pingaddr; 263static struct sockaddr_in pingaddr;
264static int pingsock = -1; 264static int pingsock = -1;
265static int datalen = DEFDATALEN; 265static int datalen; /* intentionally uninitialized to work around gcc bug */
266 266
267static long ntransmitted = 0, nreceived = 0, nrepeats = 0, pingcount = 0; 267static long ntransmitted = 0, nreceived = 0, nrepeats = 0, pingcount = 0;
268static int myid = 0, options = 0; 268static int myid = 0, options = 0;
@@ -508,6 +508,8 @@ extern int ping_main(int argc, char **argv)
508{ 508{
509 char *thisarg; 509 char *thisarg;
510 510
511 datalen = DEFDATALEN; /* initialized here rather than in global scope to work around gcc bug */
512
511 argc--; 513 argc--;
512 argv++; 514 argv++;
513 options = 0; 515 options = 0;