summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_sk.c
diff options
context:
space:
mode:
authorbmilekic <bmilekic@FreeBSD.org>2001-06-20 19:48:35 +0000
committerbmilekic <bmilekic@FreeBSD.org>2001-06-20 19:48:35 +0000
commit70d52016a3f34e35b033755b95ddad49e5f4c50c (patch)
treee79557908ee2eeed9a40c65a32399eb17abca830 /sys/pci/if_sk.c
parent398c0c0ca03faf96198e155dba0becba4e90d8da (diff)
downloadFreeBSD-src-70d52016a3f34e35b033755b95ddad49e5f4c50c.zip
FreeBSD-src-70d52016a3f34e35b033755b95ddad49e5f4c50c.tar.gz
Change m_devget()'s outdated and unused `offset' argument to actually mean
something: offset into the first mbuf of the target chain before copying the source data over. Make drivers using m_devget() with a first argument "data - ETHER_ALIGN" to use the offset argument to pass ETHER_ALIGN in. The way it was previously done is potentially dangerous if the source data was at the top of a page and the offset caused the previous page to be copied (if the previous page has not yet been appropriately mapped). The old `offset' argument in m_devget() is not used anywhere (it's always 0) and dates back to ~1995 (and earlier?) when support for ethernet trailers existed. With that support gone, it was merely collecting dust. Tested on alpha by: jlemon Partially submitted by: jlemon Reviewed by: jlemon MFC after: 3 weeks
Diffstat (limited to 'sys/pci/if_sk.c')
-rw-r--r--sys/pci/if_sk.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/pci/if_sk.c b/sys/pci/if_sk.c
index 83d5720..6c9ec6a 100644
--- a/sys/pci/if_sk.c
+++ b/sys/pci/if_sk.c
@@ -1579,8 +1579,8 @@ static void sk_rxeof(sc_if)
*/
if (sk_newbuf(sc_if, cur_rx, NULL) == ENOBUFS) {
struct mbuf *m0;
- m0 = m_devget(mtod(m, char *) - ETHER_ALIGN,
- total_len + ETHER_ALIGN, 0, ifp, NULL);
+ m0 = m_devget(mtod(m, char *), total_len, ETHER_ALIGN,
+ ifp, NULL);
sk_newbuf(sc_if, cur_rx, m);
if (m0 == NULL) {
printf("sk%d: no receive buffers "
@@ -1589,7 +1589,6 @@ static void sk_rxeof(sc_if)
ifp->if_ierrors++;
continue;
}
- m_adj(m0, ETHER_ALIGN);
m = m0;
} else {
m->m_pkthdr.rcvif = ifp;
OpenPOWER on IntegriCloud