1 Index: busybox-1.15.3/networking/ping.c
2 ===================================================================
3 --- busybox-1.15.3.orig/networking/ping.c 2010-02-28 13:47:00.000000000 +0100
4 +++ busybox-1.15.3/networking/ping.c 2010-02-28 13:47:19.000000000 +0100
9 +static unsigned datalen = DEFDATALEN;
11 static void noresp(int ign UNUSED_PARAM)
14 struct sockaddr_in pingaddr;
17 - char packet[DEFDATALEN + MAXIPLEN + MAXICMPLEN];
18 + char packet[datalen + ICMP_MINLEN + MAXIPLEN + MAXICMPLEN];
20 pingsock = create_icmp_socket();
21 pingaddr = lsa->u.sin;
23 pkt->icmp_type = ICMP_ECHO;
24 pkt->icmp_cksum = in_cksum((unsigned short *) pkt, sizeof(packet));
26 - c = xsendto(pingsock, packet, DEFDATALEN + ICMP_MINLEN,
27 + c = xsendto(pingsock, packet, datalen + ICMP_MINLEN,
28 (struct sockaddr *) &pingaddr, sizeof(pingaddr));
30 /* listen for replies */
32 struct icmp6_hdr *pkt;
35 - char packet[DEFDATALEN + MAXIPLEN + MAXICMPLEN];
36 + char packet[datalen + ICMP_MINLEN + MAXIPLEN + MAXICMPLEN];
38 pingsock = create_icmp6_socket();
39 pingaddr = lsa->u.sin6;
41 sockopt = offsetof(struct icmp6_hdr, icmp6_cksum);
42 setsockopt(pingsock, SOL_RAW, IPV6_CHECKSUM, &sockopt, sizeof(sockopt));
44 - c = xsendto(pingsock, packet, DEFDATALEN + sizeof (struct icmp6_hdr),
45 + c = xsendto(pingsock, packet, datalen + sizeof (struct icmp6_hdr),
46 (struct sockaddr *) &pingaddr, sizeof(pingaddr));
48 /* listen for replies */