Use m_copypacket() which is an optimization of the common case
m_copym(m, 0, M_COPYALL, how). This is required for strict alignment architectures where we align the IP header in the input path but m_copym() will create an unaligned copy in bridge_broadcast(). m_copypacket() preserves alignment of the first mbuf. Noticed by: Petri Simolin Approved by: mlaier (mentor) MFC after: 3 days
This commit is contained in:
parent
d8339a2616
commit
3155122ec2
@ -1404,7 +1404,7 @@ bridge_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *sa,
|
||||
used = 1;
|
||||
mc = m;
|
||||
} else {
|
||||
mc = m_copym(m, 0, M_COPYALL, M_DONTWAIT);
|
||||
mc = m_copypacket(m, M_DONTWAIT);
|
||||
if (mc == NULL) {
|
||||
sc->sc_ifp->if_oerrors++;
|
||||
continue;
|
||||
@ -1836,7 +1836,7 @@ bridge_broadcast(struct bridge_softc *sc, struct ifnet *src_if,
|
||||
mc = m;
|
||||
used = 1;
|
||||
} else {
|
||||
mc = m_copym(m, 0, M_COPYALL, M_DONTWAIT);
|
||||
mc = m_copypacket(m, M_DONTWAIT);
|
||||
if (mc == NULL) {
|
||||
sc->sc_ifp->if_oerrors++;
|
||||
continue;
|
||||
|
Loading…
x
Reference in New Issue
Block a user