summaryrefslogtreecommitdiff
path: root/sys/dev/ic/acx.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2006-12-30 22:43:02 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2006-12-30 22:43:02 +0000
commit631e97bb25e5dc9cfda3af9cba2b2679c10084fe (patch)
tree14c93a04ddfb945175ffd923ba827977102ff174 /sys/dev/ic/acx.c
parent176ba5afb38ff8c1af0458556877f76175414932 (diff)
Don't use M_DUP_PKTHDR() on static mbufs. M_DUP_PKTHDR() copies the mtag
chain and so a later MFREE() is needed to free the chain again. Just initialize a minimal mbuf header for bpf_mtap(). See earlier rum(4) commit for the full story. OK mglocker@ Sounds good jsg@
Diffstat (limited to 'sys/dev/ic/acx.c')
-rw-r--r--sys/dev/ic/acx.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/dev/ic/acx.c b/sys/dev/ic/acx.c
index b672422215a..6095233a573 100644
--- a/sys/dev/ic/acx.c
+++ b/sys/dev/ic/acx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acx.c,v 1.58 2006/12/17 21:45:48 claudio Exp $ */
+/* $OpenBSD: acx.c,v 1.59 2006/12/30 22:43:01 claudio Exp $ */
/*
* Copyright (c) 2006 Jonathan Gray <jsg@openbsd.org>
@@ -971,11 +971,12 @@ acx_start(struct ifnet *ifp)
tap->wt_chan_flags =
htole16(ic->ic_bss->ni_chan->ic_flags);
- M_DUP_PKTHDR(&mb, m);
mb.m_data = (caddr_t)tap;
mb.m_len = sc->sc_txtap_len;
mb.m_next = m;
- mb.m_pkthdr.len += mb.m_len;
+ mb.m_nextpkt = NULL;
+ mb.m_type = 0;
+ mb.m_flags = 0;
bpf_mtap(sc->sc_drvbpf, &mb, BPF_DIRECTION_OUT);
}
#endif
@@ -1328,11 +1329,12 @@ acx_rxeof(struct acx_softc *sc)
tap->wr_rssi = head->rbh_level;
tap->wr_max_rssi = ic->ic_max_rssi;
- M_DUP_PKTHDR(&mb, m);
mb.m_data = (caddr_t)tap;
mb.m_len = sc->sc_rxtap_len;
mb.m_next = m;
- mb.m_pkthdr.len += mb.m_len;
+ mb.m_nextpkt = NULL;
+ mb.m_type = 0;
+ mb.m_flags = 0;
bpf_mtap(sc->sc_drvbpf, &mb, BPF_DIRECTION_IN);
}
#endif