svn commit: trunk/busybox/networking

landley at busybox.net landley at busybox.net
Wed May 31 23:54:53 UTC 2006


Author: landley
Date: 2006-05-31 16:54:50 -0700 (Wed, 31 May 2006)
New Revision: 15256

Log:
Bugfix from Shaun Jackman: don't attempt to write 64 bytes and then fail if
the write wasn't 192 bytes long.


Modified:
   trunk/busybox/networking/ping.c


Changeset:
Modified: trunk/busybox/networking/ping.c
===================================================================
--- trunk/busybox/networking/ping.c	2006-05-31 23:23:42 UTC (rev 15255)
+++ trunk/busybox/networking/ping.c	2006-05-31 23:54:50 UTC (rev 15256)
@@ -110,8 +110,10 @@
 	c = sendto(pingsock, packet, DEFDATALEN + ICMP_MINLEN, 0,
 			   (struct sockaddr *) &pingaddr, sizeof(struct sockaddr_in));
 
-	if (c < 0 || c != sizeof(packet))
+	if (c < 0) {
+		if (ENABLE_FEATURE_CLEAN_UP) close(pingsock);
 		bb_perror_msg_and_die("sendto");
+	}
 
 	signal(SIGALRM, noresp);
 	alarm(5);					/* give the host 5000ms to respond */
@@ -135,6 +137,7 @@
 				break;
 		}
 	}
+	if (ENABLE_FEATURE_CLEAN_UP) close(pingsock);
 	printf("%s is alive!\n", hostname);
 	return;
 }




More information about the busybox-cvs mailing list