X-Git-Url: http://git.rohieb.name/openwrt.git/blobdiff_plain/aadd1adef0a9576ecd676db6c96c86d76d545a4f..e2b0a0cc9aa0c95f9eef48c44ffba0ded73a2ea3:/package/busybox/patches/450-truncated_ping_results.patch diff --git a/package/busybox/patches/450-truncated_ping_results.patch b/package/busybox/patches/450-truncated_ping_results.patch index 30e86701a..f60a1a9c0 100644 --- a/package/busybox/patches/450-truncated_ping_results.patch +++ b/package/busybox/patches/450-truncated_ping_results.patch @@ -5,7 +5,7 @@ struct icmp *pkt; int pingsock, c; - char packet[DEFDATALEN + MAXIPLEN + MAXICMPLEN]; -+ char packet[datalen + MAXIPLEN + MAXICMPLEN]; ++ char packet[datalen + ICMP_MINLEN + MAXIPLEN + MAXICMPLEN]; pingsock = create_icmp_socket(); @@ -18,17 +18,6 @@ (struct sockaddr *) &pingaddr, sizeof(struct sockaddr_in)); if (c < 0) { -@@ -257,8 +257,8 @@ - - gettimeofday(&tv, NULL); - -- /* discard if too short */ -- if (sz < (datalen + ICMP_MINLEN)) -+ /* discard if too short / long */ -+ if (sz < (datalen + ICMP_MINLEN) || sz > (MAXICMPLEN)) - return; - - /* check IP header */ @@ -274,6 +274,10 @@ ++nreceived; tp = (struct timeval *) icmppkt->icmp_data;