Now ping expects response packets same size as sent. But 8.8.8.8 limit packet 
size. This makes «ping -s 89 8.8.8.8» to fail
 
The patch removes datalen from discarding short packages and makes calculating 
header length correct
 
diff --git a/networking/ping.c b/networking/ping.c
index b7e6955a9..ecf9c569e 100644
--- a/networking/ping.c
+++ b/networking/ping.c
@@ -696,7 +696,7 @@ static int unpack4(char *buf, int sz, struct sockaddr_in 
*from)
     int hlen;
 
     /* discard if too short */
-    if (sz < (datalen + ICMP_MINLEN))
+    if (sz < (sizeof(struct iphdr) + ICMP_MINLEN))
         return 0;
 
     /* check IP header */
@@ -732,7 +732,7 @@ static int unpack6(char *packet, int sz, struct 
sockaddr_in6 *from, int hoplimit
     char buf[INET6_ADDRSTRLEN];
 
     /* discard if too short */
-    if (sz < (datalen + sizeof(struct icmp6_hdr)))
+    if (sz < sizeof(struct icmp6_hdr))
         return 0;
 
     icmppkt = (struct icmp6_hdr *) packet;
 
 
 
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to