summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorandre <andre@FreeBSD.org>2005-09-19 21:59:49 +0000
committerandre <andre@FreeBSD.org>2005-09-19 21:59:49 +0000
commit9f43a3ce6e74e152d95796d6807ec70f02d78c51 (patch)
treeca869d6b4a745c774cfef0d18c82ca3b1e306899 /sys/dev
parente825dac28c9946c7a318f73c021e65cb54ad9b88 (diff)
downloadFreeBSD-src-9f43a3ce6e74e152d95796d6807ec70f02d78c51.zip
FreeBSD-src-9f43a3ce6e74e152d95796d6807ec70f02d78c51.tar.gz
Replace custom mbuf writeability test with generic
M_WRITEABLE() test covering all edge cases too.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/fatm/if_fatm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/fatm/if_fatm.c b/sys/dev/fatm/if_fatm.c
index cf44374..30e2734 100644
--- a/sys/dev/fatm/if_fatm.c
+++ b/sys/dev/fatm/if_fatm.c
@@ -1838,7 +1838,7 @@ fatm_fix_chain(struct fatm_softc *sc, struct mbuf **mp)
d = mtod(m, u_char *);
if ((off = (uintptr_t)(void *)d % 4) != 0) {
- if (!(m->m_flags & M_EXT) || !MEXT_IS_REF(m)) {
+ if (M_WRITABLE(m)) {
sc->istats.fix_addr_copy++;
bcopy(d, d - off, m->m_len);
m->m_data = (caddr_t)(d - off);
@@ -1857,7 +1857,7 @@ fatm_fix_chain(struct fatm_softc *sc, struct mbuf **mp)
}
if ((off = m->m_len % 4) != 0) {
- if ((m->m_flags & M_EXT) && MEXT_IS_REF(m)) {
+ if (!M_WRITABLE(m)) {
if ((new = copy_mbuf(m)) == NULL) {
sc->istats.fix_len_noext++;
goto fail;
OpenPOWER on IntegriCloud