summaryrefslogtreecommitdiff
path: root/networking/ping.c
diff options
context:
space:
mode:
authorRob Landley2006-04-01 17:28:11 +0000
committerRob Landley2006-04-01 17:28:11 +0000
commit07a637df472dae766859e41aa799b6a549f107ad (patch)
tree3e25824c7d40b1aa4128605f8633e078e0d735ff /networking/ping.c
parentb0c5445bf5189c7370e33638ce1e5374f6387cf2 (diff)
downloadbusybox-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/ping.c')
-rw-r--r--networking/ping.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/networking/ping.c b/networking/ping.c
index d33cb35..7fe52ab 100644
--- a/networking/ping.c
+++ b/networking/ping.c
@@ -108,7 +108,7 @@ static void ping(const char *host)
pkt->icmp_type = ICMP_ECHO;
pkt->icmp_cksum = in_cksum((unsigned short *) pkt, sizeof(packet));
- c = sendto(pingsock, packet, sizeof(packet), 0,
+ c = sendto(pingsock, packet, DEFDATALEN + ICMP_MINLEN, 0,
(struct sockaddr *) &pingaddr, sizeof(struct sockaddr_in));
if (c < 0 || c != sizeof(packet))
@@ -202,7 +202,7 @@ static void sendping(int junk)
{
struct icmp *pkt;
int i;
- char packet[datalen + sizeof(struct icmp)];
+ char packet[datalen + ICMP_MINLEN];
pkt = (struct icmp *) packet;