Always pullup mbuf prior to accessing TCP header.

This should fix occasional Tx checksum corruption issue.

Reported by:	Garrett Cooper < yanefbsd <at> gmail dot com >
Tested by:	Garrett Cooper < yanefbsd <at> gmail dot com >
This commit is contained in:
Pyun YongHyeon 2008-09-30 04:47:49 +00:00
parent b2d4ddad82
commit 925da971b8

View File

@ -2601,6 +2601,11 @@ msk_encap(struct msk_if_softc *sc_if, struct mbuf **m_head)
(m->m_pkthdr.csum_flags & CSUM_TCP) != 0) {
uint16_t csum;
m = m_pullup(m, offset + sizeof(struct tcphdr));
if (m == NULL) {
*m_head = NULL;
return (ENOBUFS);
}
csum = in_cksum_skip(m, ntohs(ip->ip_len) + offset -
(ip->ip_hl << 2), offset);
*(uint16_t *)(m->m_data + offset +