svn commit: trunk/busybox/networking

landley at busybox.net landley at busybox.net
Wed Jan 11 03:44:12 UTC 2006


Author: landley
Date: 2006-01-10 19:44:11 -0800 (Tue, 10 Jan 2006)
New Revision: 13234

Log:
Ok, ping needs a rewrite from the ground up.  (This is not a busybox app.)
Fix bug 309, where ping -s 1 localhost would give an elapsed time 9 digits
long due to a stack overflow.  Apparently, iputils also does this.


Modified:
   trunk/busybox/networking/ping.c


Changeset:
Modified: trunk/busybox/networking/ping.c
===================================================================
--- trunk/busybox/networking/ping.c	2006-01-11 01:53:48 UTC (rev 13233)
+++ trunk/busybox/networking/ping.c	2006-01-11 03:44:11 UTC (rev 13234)
@@ -200,7 +200,7 @@
 {
 	struct icmp *pkt;
 	int i;
-	char packet[datalen + 8];
+	char packet[datalen + sizeof(struct icmp)];
 
 	pkt = (struct icmp *) packet;
 
@@ -211,7 +211,7 @@
 	pkt->icmp_id = myid;
 	CLR(ntohs(pkt->icmp_seq) % MAX_DUP_CHK);
 
-	gettimeofday((struct timeval *) &packet[8], NULL);
+	gettimeofday((struct timeval *) &pkt->icmp_dun, NULL);
 	pkt->icmp_cksum = in_cksum((unsigned short *) pkt, sizeof(packet));
 
 	i = sendto(pingsock, packet, sizeof(packet), 0,




More information about the busybox-cvs mailing list