diff options
Diffstat (limited to 'networking/ping6.c')
-rw-r--r-- | networking/ping6.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/networking/ping6.c b/networking/ping6.c index ccb19b2b5..b95e098ad 100644 --- a/networking/ping6.c +++ b/networking/ping6.c | |||
@@ -48,8 +48,6 @@ static void ping(const char *host); | |||
48 | 48 | ||
49 | /* simple version */ | 49 | /* simple version */ |
50 | 50 | ||
51 | //static struct hostent *h; | ||
52 | |||
53 | static void noresp(int ign) | 51 | static void noresp(int ign) |
54 | { | 52 | { |
55 | printf("No response from %s\n", h->h_name); | 53 | printf("No response from %s\n", h->h_name); |
@@ -58,7 +56,7 @@ static void noresp(int ign) | |||
58 | 56 | ||
59 | static void ping(const char *host) | 57 | static void ping(const char *host) |
60 | { | 58 | { |
61 | len_and_sockaddr *lsa;// | 59 | len_and_sockaddr *lsa; |
62 | struct sockaddr_in6 pingaddr; | 60 | struct sockaddr_in6 pingaddr; |
63 | struct icmp6_hdr *pkt; | 61 | struct icmp6_hdr *pkt; |
64 | int pingsock, c; | 62 | int pingsock, c; |
@@ -67,10 +65,6 @@ static void ping(const char *host) | |||
67 | 65 | ||
68 | pingsock = create_icmp6_socket(); | 66 | pingsock = create_icmp6_socket(); |
69 | 67 | ||
70 | //memset(&pingaddr, 0, sizeof(pingaddr)); | ||
71 | //pingaddr.sin6_family = AF_INET6; | ||
72 | //h = xgethostbyname2(host, AF_INET6); | ||
73 | //memcpy(&pingaddr.sin6_addr, h->h_addr, sizeof(pingaddr.sin6_addr)); | ||
74 | lsa = host_and_af2sockaddr(host, 0, AF_INET6); | 68 | lsa = host_and_af2sockaddr(host, 0, AF_INET6); |
75 | pingaddr = lsa->sin6; | 69 | pingaddr = lsa->sin6; |
76 | 70 | ||
@@ -144,8 +138,7 @@ static int myid; | |||
144 | static unsigned long tmin = ULONG_MAX, tmax, tsum; | 138 | static unsigned long tmin = ULONG_MAX, tmax, tsum; |
145 | static char rcvd_tbl[MAX_DUP_CHK / 8]; | 139 | static char rcvd_tbl[MAX_DUP_CHK / 8]; |
146 | 140 | ||
147 | //static struct hostent *hostent; | 141 | static char *hostname; |
148 | char *hostname; | ||
149 | 142 | ||
150 | static void sendping(int); | 143 | static void sendping(int); |
151 | static void pingstats(int); | 144 | static void pingstats(int); |
@@ -318,7 +311,7 @@ static void unpack(char *packet, int sz, struct sockaddr_in6 *from, int hoplimit | |||
318 | extern int BUG_bad_offsetof_icmp6_cksum(void); | 311 | extern int BUG_bad_offsetof_icmp6_cksum(void); |
319 | static void ping(const char *host) | 312 | static void ping(const char *host) |
320 | { | 313 | { |
321 | len_and_sockaddr *lsa;// | 314 | len_and_sockaddr *lsa; |
322 | char packet[datalen + MAXIPLEN + MAXICMPLEN]; | 315 | char packet[datalen + MAXIPLEN + MAXICMPLEN]; |
323 | char buf[INET6_ADDRSTRLEN]; | 316 | char buf[INET6_ADDRSTRLEN]; |
324 | int sockopt; | 317 | int sockopt; |
@@ -329,12 +322,6 @@ static void ping(const char *host) | |||
329 | 322 | ||
330 | pingsock = create_icmp6_socket(); | 323 | pingsock = create_icmp6_socket(); |
331 | 324 | ||
332 | //memset(&pingaddr, 0, sizeof(pingaddr)); | ||
333 | //pingaddr.sin6_family = AF_INET6; | ||
334 | //hostent = xgethostbyname2(host, AF_INET6); | ||
335 | //if (hostent->h_addrtype != AF_INET6) | ||
336 | // bb_error_msg_and_die("unknown address type; only AF_INET6 is currently supported"); | ||
337 | //memcpy(&pingaddr.sin6_addr, hostent->h_addr, sizeof(pingaddr.sin6_addr)); | ||
338 | lsa = host_and_af2sockaddr(host, 0, AF_INET6); | 325 | lsa = host_and_af2sockaddr(host, 0, AF_INET6); |
339 | hostname = xmalloc_sockaddr2host_noport(&lsa->sa, lsa->len); | 326 | hostname = xmalloc_sockaddr2host_noport(&lsa->sa, lsa->len); |
340 | pingaddr = lsa->sin6; | 327 | pingaddr = lsa->sin6; |