From 5d457ecbef5eba8eaeed513c65c55453de4f3975 Mon Sep 17 00:00:00 2001 From: Duncan Hare Date: Sun, 24 Jun 2018 15:40:41 -0700 Subject: net: Consolidate UDP header functions Make it possible to add TCP versions of the same, while reusing IP portions. This patch should not change any behavior. Signed-off-by: Duncan Hare Acked-by: Joe Hershberger --- net/ping.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'net/ping.c') 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; -- cgit v1.2.3