Fix a case where the return value from m_copy() was not being checked
for NULL before proceeding, causing a crash if mbufs were exhausted. MFC after: 3 days Reported by: Mark Gooderum <mark@verniernetworks.com>
This commit is contained in:
parent
485007051a
commit
84db389df4
@ -281,13 +281,13 @@ ether_output(ifp, m, dst, rt0)
|
||||
|
||||
if ((m->m_flags & M_BCAST) || (loop_copy > 0)) {
|
||||
struct mbuf *n;
|
||||
n = m_copy(m, 0, (int)M_COPYALL);
|
||||
|
||||
n->m_pkthdr.csum_flags |= csum_flags;
|
||||
if (csum_flags & CSUM_DATA_VALID)
|
||||
n->m_pkthdr.csum_data = 0xffff;
|
||||
|
||||
(void) if_simloop(ifp, n, dst->sa_family, hlen);
|
||||
if ((n = m_copy(m, 0, (int)M_COPYALL)) != NULL) {
|
||||
n->m_pkthdr.csum_flags |= csum_flags;
|
||||
if (csum_flags & CSUM_DATA_VALID)
|
||||
n->m_pkthdr.csum_data = 0xffff;
|
||||
(void)if_simloop(ifp, n, dst->sa_family, hlen);
|
||||
}
|
||||
} else if (bcmp(eh->ether_dhost, eh->ether_shost,
|
||||
ETHER_ADDR_LEN) == 0) {
|
||||
m->m_pkthdr.csum_flags |= csum_flags;
|
||||
|
Loading…
Reference in New Issue
Block a user