Changeset View
Changeset View
Standalone View
Standalone View
sbin/ping/ping.c
Context not available. | |||||
cc = ICMP_MINLEN + phdr_len + datalen; | cc = ICMP_MINLEN + phdr_len + datalen; | ||||
/* compute ICMP checksum here */ | /* compute ICMP checksum here */ | ||||
icp->icmp_cksum = in_cksum((u_char *)icp, cc); | icp->icmp_cksum = in_cksum((u_char *)icp, sizeof(struct ip), IP_MAXPACKET, cc); | ||||
if (options & F_HDRINCL) { | if (options & F_HDRINCL) { | ||||
cc += sizeof(struct ip); | cc += sizeof(struct ip); | ||||
ip = (struct ip *)outpackhdr; | ip = (struct ip *)outpackhdr; | ||||
ip->ip_len = htons(cc); | ip->ip_len = htons(cc); | ||||
ip->ip_sum = in_cksum(outpackhdr, cc); | ip->ip_sum = in_cksum(outpackhdr, sizeof(struct ip), IP_MAXPACKET, cc); | ||||
packet = outpackhdr; | packet = outpackhdr; | ||||
} | } | ||||
i = send(ssend, (char *)packet, cc, 0); | i = send(ssend, (char *)packet, cc, 0); | ||||
Context not available. |