diff options
author | ae <ae@FreeBSD.org> | 2017-03-07 03:53:09 +0000 |
---|---|---|
committer | ae <ae@FreeBSD.org> | 2017-03-07 03:53:09 +0000 |
commit | f645cab8e18c556fcb35d1c78a5f585e5bd379e2 (patch) | |
tree | e11742f25a9dec076059dda98692e27602dc255d /sys/netinet6 | |
parent | d8d9b7ceb2c85e8d697f883da6050fcce8209513 (diff) | |
download | FreeBSD-src-f645cab8e18c556fcb35d1c78a5f585e5bd379e2.zip FreeBSD-src-f645cab8e18c556fcb35d1c78a5f585e5bd379e2.tar.gz |
MFC r314430:
When IPv6 fragments reassembly is complete, update mbuf's csum_data
and csum_flags using information from all fragments. This fixes
dropping of reassembled packets due to wrong checksum when the IPv6
checksum offloading is enabled on a network card.
Diffstat (limited to 'sys/netinet6')
-rw-r--r-- | sys/netinet6/frag6.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/netinet6/frag6.c b/sys/netinet6/frag6.c index 9dd642a..906c65f 100644 --- a/sys/netinet6/frag6.c +++ b/sys/netinet6/frag6.c @@ -533,6 +533,11 @@ insert: af6 = ip6af->ip6af_down; frag6_deq(ip6af); while (af6 != (struct ip6asfrag *)q6) { + m->m_pkthdr.csum_flags &= + IP6_REASS_MBUF(af6)->m_pkthdr.csum_flags; + m->m_pkthdr.csum_data += + IP6_REASS_MBUF(af6)->m_pkthdr.csum_data; + af6dwn = af6->ip6af_down; frag6_deq(af6); while (t->m_next) @@ -543,6 +548,10 @@ insert: af6 = af6dwn; } + while (m->m_pkthdr.csum_data & 0xffff0000) + m->m_pkthdr.csum_data = (m->m_pkthdr.csum_data & 0xffff) + + (m->m_pkthdr.csum_data >> 16); + /* adjust offset to point where the original next header starts */ offset = ip6af->ip6af_offset - sizeof(struct ip6_frag); free(ip6af, M_FTABLE); |