From a8f964c8c62b86f839eb9871bc1603f00cd03c6b Mon Sep 17 00:00:00 2001 From: mlaier Date: Tue, 3 Jul 2007 11:50:02 +0000 Subject: Fix hardware checksum verification on fragments. MFC after: 7 days Reported/tested by: Hugo Koji Kobayashi, Vadym Chepkov Reviewed/help by: yongari Approved by: re (kensmith) --- sys/contrib/pf/net/pf_norm.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'sys/contrib') diff --git a/sys/contrib/pf/net/pf_norm.c b/sys/contrib/pf/net/pf_norm.c index 98ed5fb..0153644 100644 --- a/sys/contrib/pf/net/pf_norm.c +++ b/sys/contrib/pf/net/pf_norm.c @@ -566,8 +566,17 @@ pf_reassemble(struct mbuf **m0, struct pf_fragment **frag, m2 = frent->fr_m; pool_put(&pf_frent_pl, frent); pf_nfrents--; +#ifdef __FreeBSD__ + m->m_pkthdr.csum_flags &= m2->m_pkthdr.csum_flags; + m->m_pkthdr.csum_data += m2->m_pkthdr.csum_data; +#endif m_cat(m, m2); } +#ifdef __FreeBSD__ + while (m->m_pkthdr.csum_data & 0xffff0000) + m->m_pkthdr.csum_data = (m->m_pkthdr.csum_data & 0xffff) + + (m->m_pkthdr.csum_data >> 16); +#endif ip->ip_src = (*frag)->fr_src; ip->ip_dst = (*frag)->fr_dst; -- cgit v1.1