diff options
author | Rob Landley | 2006-04-01 17:28:11 +0000 |
---|---|---|
committer | Rob Landley | 2006-04-01 17:28:11 +0000 |
commit | 07a637df472dae766859e41aa799b6a549f107ad (patch) | |
tree | 3e25824c7d40b1aa4128605f8633e078e0d735ff /networking/ping6.c | |
parent | b0c5445bf5189c7370e33638ce1e5374f6387cf2 (diff) | |
download | busybox-07a637df472dae766859e41aa799b6a549f107ad.zip busybox-07a637df472dae766859e41aa799b6a549f107ad.tar.gz |
Patch from KRONSTORFER Horst to Fix a size mismatch in ping, such as the 56/84
mismatch inthe following example:
# ping -c 1 172.16.2.1
PING 172.16.2.1 (172.16.2.1): 56 data bytes
84 bytes from 172.16.2.1: icmp_seq=0 ttl=64 time=0.2 ms
Diffstat (limited to 'networking/ping6.c')
-rw-r--r-- | networking/ping6.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/networking/ping6.c b/networking/ping6.c index 4e55081..3f632e0 100644 --- a/networking/ping6.c +++ b/networking/ping6.c @@ -111,7 +111,7 @@ static void ping(const char *host) setsockopt(pingsock, SOL_RAW, IPV6_CHECKSUM, (char *) &sockopt, sizeof(sockopt)); - c = sendto(pingsock, packet, sizeof(packet), 0, + c = sendto(pingsock, packet, DEFDATALEN + sizeof (struct icmp6_hdr), 0, (struct sockaddr *) &pingaddr, sizeof(struct sockaddr_in6)); if (c < 0 || c != sizeof(packet)) @@ -204,7 +204,7 @@ static void sendping(int junk) { struct icmp6_hdr *pkt; int i; - char packet[datalen + 8]; + char packet[datalen + sizeof (struct icmp6_hdr)]; pkt = (struct icmp6_hdr *) packet; |