It is not safe to use m_copypacket() here as the returned mbuf is readonly,

change to m_dup and keep the alignment on the layer3 header.

MFC after:	1 week
This commit is contained in:
Andrew Thompson 2005-12-15 19:34:39 +00:00
parent 04ddb211d5
commit 7536320f62
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=153458

View File

@ -1858,7 +1858,12 @@ bridge_input(struct ifnet *ifp, struct mbuf *m)
*/
KASSERT(bifp->if_bridge == NULL,
("loop created in bridge_input"));
mc2 = m_copypacket(m, M_DONTWAIT);
mc2 = m_dup(m, M_DONTWAIT);
if (mc2 != NULL) {
/* Keep the layer3 header aligned */
int i = min(mc2->m_pkthdr.len, max_protohdr);
mc2 = m_copyup(mc2, i, ETHER_ALIGN);
}
if (mc2 != NULL) {
mc2->m_pkthdr.rcvif = bifp;
(*bifp->if_input)(bifp, mc2);