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:
thompsa 2005-12-15 19:34:39 +00:00
parent 71d1cb326f
commit dd0db6b7bf

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);