aboutsummaryrefslogtreecommitdiff
path: root/networking/ping6.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-01-24 22:02:01 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-01-24 22:02:01 +0000
commit218f2f4882482e1d023ddbf4b9f6cbf1f6b0145d (patch)
treee58717abf91e17db281fbbdfdc0072c198ce85b7 /networking/ping6.c
parent84d2d493b4b664d1465cff955367fb9bc7769e5d (diff)
downloadbusybox-218f2f4882482e1d023ddbf4b9f6cbf1f6b0145d.tar.gz
accumulated post-1.4.0 fixes
Diffstat (limited to 'networking/ping6.c')
-rw-r--r--networking/ping6.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/networking/ping6.c b/networking/ping6.c
index b95e098ad..c691fa74b 100644
--- a/networking/ping6.c
+++ b/networking/ping6.c
@@ -42,6 +42,8 @@ enum {
PINGINTERVAL = 1 /* second */
};
+static const char *hostname;
+
static void ping(const char *host);
#ifndef CONFIG_FEATURE_FANCY_PING6
@@ -50,7 +52,7 @@ static void ping(const char *host);
static void noresp(int ign)
{
- printf("No response from %s\n", h->h_name);
+ printf("No response from %s\n", hostname);
exit(EXIT_FAILURE);
}
@@ -63,6 +65,8 @@ static void ping(const char *host)
int sockopt;
char packet[DEFDATALEN + MAXIPLEN + MAXICMPLEN];
+ hostname = host;
+
pingsock = create_icmp6_socket();
lsa = host_and_af2sockaddr(host, 0, AF_INET6);
@@ -105,7 +109,7 @@ static void ping(const char *host)
}
if (ENABLE_FEATURE_CLEAN_UP)
close(pingsock);
- printf("%s is alive!\n", h->h_name);
+ printf("%s is alive!\n", hostname);
}
int ping6_main(int argc, char **argv)