1 --- a/networking/ping.c
2 +++ b/networking/ping.c
4 struct sockaddr_in pingaddr;
7 - char packet[DEFDATALEN + MAXIPLEN + MAXICMPLEN];
8 + char packet[datalen + ICMP_MINLEN + MAXIPLEN + MAXICMPLEN];
10 pingsock = create_icmp_socket();
11 pingaddr = lsa->u.sin;
13 pkt->icmp_type = ICMP_ECHO;
14 pkt->icmp_cksum = in_cksum((unsigned short *) pkt, sizeof(packet));
16 - c = xsendto(pingsock, packet, DEFDATALEN + ICMP_MINLEN,
17 + c = xsendto(pingsock, packet, datalen + ICMP_MINLEN,
18 (struct sockaddr *) &pingaddr, sizeof(pingaddr));
20 /* listen for replies */
22 struct icmp6_hdr *pkt;
25 - char packet[DEFDATALEN + MAXIPLEN + MAXICMPLEN];
26 + char packet[datalen + ICMP_MINLEN + MAXIPLEN + MAXICMPLEN];
28 pingsock = create_icmp6_socket();
29 pingaddr = lsa->u.sin6;
31 sockopt = offsetof(struct icmp6_hdr, icmp6_cksum);
32 setsockopt(pingsock, SOL_RAW, IPV6_CHECKSUM, &sockopt, sizeof(sockopt));
34 - c = xsendto(pingsock, packet, DEFDATALEN + sizeof (struct icmp6_hdr),
35 + c = xsendto(pingsock, packet, datalen + sizeof (struct icmp6_hdr),
36 (struct sockaddr *) &pingaddr, sizeof(pingaddr));
38 /* listen for replies */