summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2020-02-17 20:57:59 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2020-02-17 20:57:59 +0000
commit883fd5c2c793c77bbb64b379aba5337855b13fec (patch)
tree52ba41a7ab2eca45761f7d58d8cffa8be447f64e
parent1735713db7739a79fb0f9f30c7235f2ceb2d69c2 (diff)
Don't fake up an mbuf to prepend a readiotap header, just use bpf_mtap_hdr().
OK claudio@
-rw-r--r--sys/dev/ic/ar9003.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/sys/dev/ic/ar9003.c b/sys/dev/ic/ar9003.c
index ca4a71dbeaa..ebe08ff66a7 100644
--- a/sys/dev/ic/ar9003.c
+++ b/sys/dev/ic/ar9003.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ar9003.c,v 1.49 2019/09/12 12:55:06 stsp Exp $ */
+/* $OpenBSD: ar9003.c,v 1.50 2020/02/17 20:57:58 claudio Exp $ */
/*-
* Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr>
@@ -856,7 +856,6 @@ ar9003_rx_radiotap(struct athn_softc *sc, struct mbuf *m,
struct athn_rx_radiotap_header *tap = &sc->sc_rxtap;
struct ieee80211com *ic = &sc->sc_ic;
- struct mbuf mb;
uint64_t tsf;
uint32_t tstamp;
uint8_t rate;
@@ -905,13 +904,7 @@ ar9003_rx_radiotap(struct athn_softc *sc, struct mbuf *m,
case 0xc: tap->wr_rate = 108; break;
}
}
- mb.m_data = (caddr_t)tap;
- mb.m_len = sc->sc_rxtap_len;
- mb.m_next = m;
- mb.m_nextpkt = NULL;
- mb.m_type = 0;
- mb.m_flags = 0;
- bpf_mtap(sc->sc_drvbpf, &mb, BPF_DIRECTION_IN);
+ bpf_mtap_hdr(sc->sc_drvbpf, tap, sc->sc_rxtap_len, m, BPF_DIRECTION_IN);
}
#endif
@@ -1484,7 +1477,6 @@ ar9003_tx(struct athn_softc *sc, struct mbuf *m, struct ieee80211_node *ni,
#if NBPFILTER > 0
if (__predict_false(sc->sc_drvbpf != NULL)) {
struct athn_tx_radiotap_header *tap = &sc->sc_txtap;
- struct mbuf mb;
tap->wt_flags = 0;
/* Use initial transmit rate. */
@@ -1496,13 +1488,8 @@ ar9003_tx(struct athn_softc *sc, struct mbuf *m, struct ieee80211_node *ni,
ridx[0] != ATHN_RIDX_CCK1 &&
(ic->ic_flags & IEEE80211_F_SHPREAMBLE))
tap->wt_flags |= IEEE80211_RADIOTAP_F_SHORTPRE;
- mb.m_data = (caddr_t)tap;
- mb.m_len = sc->sc_txtap_len;
- mb.m_next = m;
- mb.m_nextpkt = NULL;
- mb.m_type = 0;
- mb.m_flags = 0;
- bpf_mtap(sc->sc_drvbpf, &mb, BPF_DIRECTION_OUT);
+ bpf_mtap_hdr(sc->sc_drvbpf, tap, sc->sc_txtap_len, m,
+ BPF_DIRECTION_OUT);
}
#endif