diff options
author | Bosko Milekic <bmilekic@FreeBSD.org> | 2001-06-20 19:48:35 +0000 |
---|---|---|
committer | Bosko Milekic <bmilekic@FreeBSD.org> | 2001-06-20 19:48:35 +0000 |
commit | f5eece3fb99157ec3643100faf15515097904f54 (patch) | |
tree | e79557908ee2eeed9a40c65a32399eb17abca830 /sys/dev/sf | |
parent | 5a69ac96f564f1aa593d5d962e0919c5ad7406a8 (diff) | |
download | src-f5eece3fb99157ec3643100faf15515097904f54.tar.gz src-f5eece3fb99157ec3643100faf15515097904f54.zip |
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
Notes
Notes:
svn path=/head/; revision=78508
Diffstat (limited to 'sys/dev/sf')
-rw-r--r-- | sys/dev/sf/if_sf.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/dev/sf/if_sf.c b/sys/dev/sf/if_sf.c index dd26fca1e7af..e0d0149cc193 100644 --- a/sys/dev/sf/if_sf.c +++ b/sys/dev/sf/if_sf.c @@ -989,14 +989,13 @@ static void sf_rxeof(sc) continue; } - m0 = m_devget(mtod(m, char *) - ETHER_ALIGN, - cur_rx->sf_len + ETHER_ALIGN, 0, ifp, NULL); + m0 = m_devget(mtod(m, char *), cur_rx->sf_len, ETHER_ALIGN, + ifp, NULL); sf_newbuf(sc, desc, m); if (m0 == NULL) { ifp->if_ierrors++; continue; } - m_adj(m0, ETHER_ALIGN); m = m0; eh = mtod(m, struct ether_header *); |