HomeFreeBSD

Merge r1.22-1.23 from NetBSD:

Description

Merge r1.22-1.23 from NetBSD:

Don't assume M_PKTHDR is set only on the first mbuf of the chain.
The check is replaced by (m1 != m), which is equivalent to the previous
code: we want to modify m->m_pkthdr.len only when 'm' was not passed in
m_adj().

Fix a pretty bad mistake, that has always been there:
 m_adj(m1, -(m1->m_len - roff));
 if (m1 != m)

m->m_pkthdr.len -= (m1->m_len - roff);

This is wrong: m_adj() will modify m1->m_len, so we're using a wrong
value when manually adjusting m->m_pkthdr.len.

Reported by: Maxime Villard <max at m00nbsd dot net>
Obtained from: NetBSD
MFC after: 1 week

Details

Provenance
aeAuthored on
Parents
rS333015: Add network device event for priority code point, PCP, changes.
Branches
Unknown
Tags
Unknown