aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2003-01-12 06:08:33 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2003-01-12 06:08:33 +0000
commitb1d5dd0109aaeb46f1a448324236ac4afd50014e (patch)
treec5ce74999159be05372f47a6cfac9610019fa749
parentfaa73decef96982478f6fb550c1e2ec9dd23c108 (diff)
downloadbusybox-w32-b1d5dd0109aaeb46f1a448324236ac4afd50014e.tar.gz
busybox-w32-b1d5dd0109aaeb46f1a448324236ac4afd50014e.tar.bz2
busybox-w32-b1d5dd0109aaeb46f1a448324236ac4afd50014e.zip
Kiss Gabor noticed that ping compiled without BB_FEATURE_FANCY_PING
would return 0 instead of EXIT_FAILURE when no response was received. git-svn-id: svn://busybox.net/trunk/busybox@6321 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r--networking/ping.c4
-rw-r--r--networking/ping6.c13
2 files changed, 8 insertions, 9 deletions
diff --git a/networking/ping.c b/networking/ping.c
index f21f2b1a8..044b547ac 100644
--- a/networking/ping.c
+++ b/networking/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.52 2002/06/06 11:47:00 andersen Exp $ 3 * $Id: ping.c,v 1.53 2003/01/12 06:08:33 andersen 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>
@@ -179,7 +179,7 @@ static char *hostname = NULL;
179static void noresp(int ign) 179static void noresp(int ign)
180{ 180{
181 printf("No response from %s\n", hostname); 181 printf("No response from %s\n", hostname);
182 exit(0); 182 exit(EXIT_FAILURE);
183} 183}
184 184
185static void ping(const char *host) 185static void ping(const char *host)
diff --git a/networking/ping6.c b/networking/ping6.c
index 8e14647eb..f1ccff483 100644
--- a/networking/ping6.c
+++ b/networking/ping6.c
@@ -1,6 +1,6 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * $Id: ping6.c,v 1.2 2002/11/26 03:03:41 bug1 Exp $ 3 * $Id: ping6.c,v 1.3 2003/01/12 06:08:33 andersen 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>
@@ -77,6 +77,11 @@ static void ping(const char *host);
77 77
78/* simple version */ 78/* simple version */
79#ifndef CONFIG_FEATURE_FANCY_PING6 79#ifndef CONFIG_FEATURE_FANCY_PING6
80void noresp(int ign)
81{
82 printf("No response from %s\n", h->h_name);
83 exit(EXIT_FAILURE);
84}
80 85
81static void ping(const char *host) 86static void ping(const char *host)
82{ 87{
@@ -87,12 +92,6 @@ static void ping(const char *host)
87 int sockopt; 92 int sockopt;
88 char packet[DEFDATALEN + MAXIPLEN + MAXICMPLEN]; 93 char packet[DEFDATALEN + MAXIPLEN + MAXICMPLEN];
89 94
90 void noresp(int ign)
91 {
92 printf("No response from %s\n", h->h_name);
93 exit(0);
94 }
95
96 pingsock = create_icmp6_socket(); 95 pingsock = create_icmp6_socket();
97 96
98 memset(&pingaddr, 0, sizeof(struct sockaddr_in)); 97 memset(&pingaddr, 0, sizeof(struct sockaddr_in));