summaryrefslogtreecommitdiff
path: root/net/ping.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ping.c')
-rw-r--r--net/ping.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/net/ping.c b/net/ping.c
index 821d35d01d..633c942e67 100644
--- a/net/ping.c
+++ b/net/ping.c
@@ -22,14 +22,9 @@ static void set_icmp_header(uchar *pkt, struct in_addr dest)
/*
* Construct an IP and ICMP header.
*/
- struct ip_hdr *ip = (struct ip_hdr *)pkt;
struct icmp_hdr *icmp = (struct icmp_hdr *)(pkt + IP_HDR_SIZE);
- net_set_ip_header(pkt, dest, net_ip);
-
- ip->ip_len = htons(IP_ICMP_HDR_SIZE);
- ip->ip_p = IPPROTO_ICMP;
- ip->ip_sum = compute_ip_checksum(ip, IP_HDR_SIZE);
+ net_set_ip_header(pkt, dest, net_ip, IP_ICMP_HDR_SIZE, IPPROTO_ICMP);
icmp->type = ICMP_ECHO_REQUEST;
icmp->code = 0;