diff options
author | wpaul <wpaul@FreeBSD.org> | 2000-03-29 20:06:15 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 2000-03-29 20:06:15 +0000 |
commit | 43e2d9b0027a1362dd7f088c4a293be72418bc70 (patch) | |
tree | 713cd7882be82cbd31b31f0420d6dad286542fc4 /sys/pci/if_rl.c | |
parent | 4735ae9feca60a66a9f07344895484f55968f156 (diff) | |
download | FreeBSD-src-43e2d9b0027a1362dd7f088c4a293be72418bc70.zip FreeBSD-src-43e2d9b0027a1362dd7f088c4a293be72418bc70.tar.gz |
Two fixes for the RealTek:
- Only call m_pullup() when necessary.
- Check return value from rl_encap() in rl_start() to avoid panic when
we run out of mbufs. (Fixes PR kern/17582)
PR: kern/17582
Diffstat (limited to 'sys/pci/if_rl.c')
-rw-r--r-- | sys/pci/if_rl.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/pci/if_rl.c b/sys/pci/if_rl.c index a6c0aaa..6d7bc55 100644 --- a/sys/pci/if_rl.c +++ b/sys/pci/if_rl.c @@ -1130,7 +1130,9 @@ static void rl_rxeof(sc) m_adj(m, RL_ETHER_ALIGN); m_copyback(m, wrap, total_len - wrap, sc->rl_cdata.rl_rx_buf); - m = m_pullup(m, sizeof(struct ether_header)); + if (m->m_len < sizeof(struct ether_header)) + m = m_pullup(m, + sizeof(struct ether_header)); if (m == NULL) { printf("rl%d: m_pullup failed", sc->rl_unit); @@ -1385,7 +1387,11 @@ static void rl_start(ifp) if (m_head == NULL) break; - rl_encap(sc, m_head); + if (rl_encap(sc, m_head)) { + IF_PREPEND(&ifp->if_snd, m_head); + ifp->if_flags |= IFF_OACTIVE; + break; + } /* * If there's a BPF listener, bounce a copy of this frame |