diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2013-11-26 11:27:42 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2013-11-26 11:27:42 +0000 |
commit | b6ce7dbf3c6f913775c2f544f55d2c9865703b37 (patch) | |
tree | 1aa4c8244a13929aa47c6af4d4ac214d6df9c8b6 /sys/netinet/ip_icmp.c | |
parent | b5e47c416a7237847a1f480b373629a051249c45 (diff) |
instead of calculating the icmp checksum here, just set the flag that
it is needed and the lower parts of the stack will take care of it.
fixes a cksum bug in a rather constructed case and is just the right thing
to do now. ok mpi naddy
Diffstat (limited to 'sys/netinet/ip_icmp.c')
-rw-r--r-- | sys/netinet/ip_icmp.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index 5ea912e2f31..b8da8bb582e 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_icmp.c,v 1.110 2013/11/17 10:07:32 bluhm Exp $ */ +/* $OpenBSD: ip_icmp.c,v 1.111 2013/11/26 11:27:41 henning Exp $ */ /* $NetBSD: ip_icmp.c,v 1.19 1996/02/13 23:42:22 christos Exp $ */ /* @@ -817,8 +817,7 @@ icmp_reflect(struct mbuf *m, struct mbuf **op, struct in_ifaddr *ia) } /* - * Send an icmp packet back to the ip level, - * after supplying a checksum. + * Send an icmp packet back to the ip level */ void icmp_send(struct mbuf *m, struct mbuf *opts) @@ -830,7 +829,7 @@ icmp_send(struct mbuf *m, struct mbuf *opts) 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); + m->m_pkthdr.csum_flags |= M_ICMP_CSUM_OUT; #ifdef ICMPPRINTFS if (icmpprintfs) { char dst[INET_ADDRSTRLEN], src[INET_ADDRSTRLEN]; |