Re: in_proto_cksum_out: fix ICMP checksum calculation

2013-08-08 Thread Alexander Bluhm
On Mon, Aug 05, 2013 at 10:28:57AM -0400, Lawrence Teo wrote: Index: ip_output.c === RCS file: /cvs/src/sys/netinet/ip_output.c,v retrieving revision 1.244 diff -U5 -p -r1.244 ip_output.c --- ip_output.c 31 Jul 2013

in_proto_cksum_out: fix ICMP checksum calculation

2013-08-05 Thread Lawrence Teo
in_proto_cksum_out() currently calculates ICMP checksums like this: hlen = ip-ip_hl 2; icp = (struct icmp *)(mtod(m, caddr_t) + hlen); icp-icmp_cksum = 0; icp-icmp_cksum = in4_cksum(m, 0, hlen, ntohs(ip-ip_len) - hlen); However this won't work if the