mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-14 10:09:48 +00:00
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
11edc1e0d7
commit
79db6ff316
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=113919
@ -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