summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2012-05-26 23:58:51 +0000
committerbz <bz@FreeBSD.org>2012-05-26 23:58:51 +0000
commit2d07c3f75f4ae8a90074cef66e4a388067c69396 (patch)
tree1c9bf908ce41f221f0d2f716fa700f62810688da
parent04c4fe086c5ff9a10ab7aeead7bf8d9482df141d (diff)
downloadFreeBSD-src-2d07c3f75f4ae8a90074cef66e4a388067c69396.zip
FreeBSD-src-2d07c3f75f4ae8a90074cef66e4a388067c69396.tar.gz
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
-rw-r--r--sys/netinet6/ip6_output.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
index f2dd552..ec2d9bd 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
OpenPOWER on IntegriCloud