From 70d52016a3f34e35b033755b95ddad49e5f4c50c Mon Sep 17 00:00:00 2001 From: bmilekic Date: Wed, 20 Jun 2001 19:48:35 +0000 Subject: 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 --- sys/dev/vx/if_vx.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'sys/dev/vx') diff --git a/sys/dev/vx/if_vx.c b/sys/dev/vx/if_vx.c index e1fa760..f475080 100644 --- a/sys/dev/vx/if_vx.c +++ b/sys/dev/vx/if_vx.c @@ -691,15 +691,12 @@ again: { struct mbuf *m0; - m0 = m_devget(mtod(m, char *) - ETHER_ALIGN, - m->m_pkthdr.len + ETHER_ALIGN, 0, ifp, NULL); - + m0 = m_devget(mtod(m, char *), m->m_pkthdr.len, ETHER_ALIGN, ifp, NULL); if (m0 == NULL) { ifp->if_ierrors++; goto abort; } - m_adj(m0, ETHER_ALIGN); m_freem(m); m = m0; } -- cgit v1.1