aboutsummaryrefslogtreecommitdiff
path: root/networking/ping.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-06-16 13:37:59 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-06-16 13:37:59 +0000
commit7b72fc12000c878e11d5f0b245f83c0d71b29f58 (patch)
treeae60975a107756cb3b7b6dd17e8f0d41427daed6 /networking/ping.c
parent53a0e971960a520bd859b8aac6dbebec2045115f (diff)
downloadbusybox-w32-7b72fc12000c878e11d5f0b245f83c0d71b29f58.tar.gz
busybox-w32-7b72fc12000c878e11d5f0b245f83c0d71b29f58.tar.bz2
busybox-w32-7b72fc12000c878e11d5f0b245f83c0d71b29f58.zip
pscan: new applet (portscanner). ~1350 bytes. By Tito <farmatito@tiscali.it>
wget: lift 256 chars limitation on terminal width
Diffstat (limited to 'networking/ping.c')
-rw-r--r--networking/ping.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/networking/ping.c b/networking/ping.c
index 6b5045eb3..e94b7914f 100644
--- a/networking/ping.c
+++ b/networking/ping.c
@@ -341,7 +341,12 @@ static void sendping4(int junk ATTRIBUTE_UNUSED)
341 pkt->icmp_cksum = 0; 341 pkt->icmp_cksum = 0;
342 pkt->icmp_seq = htons(ntransmitted); /* don't ++ here, it can be a macro */ 342 pkt->icmp_seq = htons(ntransmitted); /* don't ++ here, it can be a macro */
343 pkt->icmp_id = myid; 343 pkt->icmp_id = myid;
344
345// I can't fucking believe someone thought it's okay to do it like this...
346// where's hton? Where is a provision for different word size, structure padding, etc??
347// FIXME!
344 gettimeofday((struct timeval *) &pkt->icmp_dun, NULL); 348 gettimeofday((struct timeval *) &pkt->icmp_dun, NULL);
349
345 pkt->icmp_cksum = in_cksum((unsigned short *) pkt, datalen + ICMP_MINLEN); 350 pkt->icmp_cksum = in_cksum((unsigned short *) pkt, datalen + ICMP_MINLEN);
346 351
347 sendping_tail(sendping4, pkt, datalen + ICMP_MINLEN); 352 sendping_tail(sendping4, pkt, datalen + ICMP_MINLEN);
@@ -356,6 +361,8 @@ static void sendping6(int junk ATTRIBUTE_UNUSED)
356 pkt->icmp6_cksum = 0; 361 pkt->icmp6_cksum = 0;
357 pkt->icmp6_seq = htons(ntransmitted); /* don't ++ here, it can be a macro */ 362 pkt->icmp6_seq = htons(ntransmitted); /* don't ++ here, it can be a macro */
358 pkt->icmp6_id = myid; 363 pkt->icmp6_id = myid;
364
365// FIXME!
359 gettimeofday((struct timeval *) &pkt->icmp6_data8[4], NULL); 366 gettimeofday((struct timeval *) &pkt->icmp6_data8[4], NULL);
360 367
361 sendping_tail(sendping6, pkt, datalen + sizeof(struct icmp6_hdr)); 368 sendping_tail(sendping6, pkt, datalen + sizeof(struct icmp6_hdr));