diff options
author | Bjoern A. Zeeb <bz@FreeBSD.org> | 2012-05-26 23:58:51 +0000 |
---|---|---|
committer | Bjoern A. Zeeb <bz@FreeBSD.org> | 2012-05-26 23:58:51 +0000 |
commit | c69baa7e919ddee6f2341355cb4f542e2d46026e (patch) | |
tree | 1c9bf908ce41f221f0d2f716fa700f62810688da /sys/netinet6 | |
parent | 73c77d26148e15576918e43f5defe51e7068e17f (diff) | |
download | src-c69baa7e919ddee6f2341355cb4f542e2d46026e.tar.gz src-c69baa7e919ddee6f2341355cb4f542e2d46026e.zip |
Correctly get the payload length in host byte order. While we
already plan to support >64k payload here, the IPv6 header payload
length obviously is only 16 bit and the calculations need to be right.
Reported by: dim
Tested by: dim
MFC after: 1 day
X-MFC: with r235958
Notes
Notes:
svn path=/head/; revision=236130
Diffstat (limited to 'sys/netinet6')
-rw-r--r-- | sys/netinet6/ip6_output.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index f2dd552db233..ec2d9bdcc839 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -189,13 +189,13 @@ in6_delayed_cksum(struct mbuf *m, uint32_t plen, u_short offset) { u_short csum; - csum = in_cksum_skip(m, ntohl(plen), offset); + csum = in_cksum_skip(m, offset + plen, offset); if (m->m_pkthdr.csum_flags & CSUM_UDP && csum == 0) csum = 0xffff; offset += m->m_pkthdr.csum_data; /* checksum offset */ if (offset + sizeof(u_short) > m->m_len) { - printf("%s: delayed m_pullup, m->len: %d off: %d\n", + printf("%s: delayed m_pullup, m->len: %d off: %d\n", __func__, m->m_len, offset); /* * XXX this should not happen, but if it does, the correct @@ -962,7 +962,7 @@ passout: */ if (sw_csum & CSUM_DELAY_DATA) { sw_csum &= ~CSUM_DELAY_DATA; - in6_delayed_cksum(m, ip6->ip6_plen, sizeof(struct ip6_hdr)); + in6_delayed_cksum(m, plen, sizeof(struct ip6_hdr)); } #ifdef SCTP if (sw_csum & CSUM_SCTP) { @@ -1077,7 +1077,7 @@ passout: * XXX-BZ handle the hw offloading case. Need flags. */ if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { - in6_delayed_cksum(m, ip6->ip6_plen, sizeof(*ip6)); + in6_delayed_cksum(m, plen, hlen); m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; } #ifdef SCTP |