diff options
author | Andrey V. Elsukov <ae@FreeBSD.org> | 2017-02-28 22:58:19 +0000 |
---|---|---|
committer | Andrey V. Elsukov <ae@FreeBSD.org> | 2017-02-28 22:58:19 +0000 |
commit | 9907aba3704685d2ab7138204fe99a81a312d62d (patch) | |
tree | b57fbbd596cc182f83851f598f4e68c64cc78d84 /sys | |
parent | 2e6e48fb59e76a93852063e6c427d735ef4aa9ba (diff) | |
download | src-9907aba3704685d2ab7138204fe99a81a312d62d.tar.gz src-9907aba3704685d2ab7138204fe99a81a312d62d.zip |
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.
Obtained from: Yandex LLC
MFC after: 1 week
Sponsored by: Yandex LLC
Notes
Notes:
svn path=/head/; revision=314430
Diffstat (limited to 'sys')
-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 b0aa5fe6573e..df1f72285faf 100644 --- a/sys/netinet6/frag6.c +++ b/sys/netinet6/frag6.c @@ -528,6 +528,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) @@ -538,6 +543,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); |