diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2007-01-03 18:16:44 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2007-01-03 18:16:44 +0000 |
commit | 5747ef0336e7eb48a2f47780d36d81c50853ad57 (patch) | |
tree | b0e94fe2002ba4bbe5644d0ce74a9baf16ed4cec /sys/dev | |
parent | 73da0e19b784af4731da49fd23a668736b73fec5 (diff) |
M_DUP_PKTHDR() cleanup. On static buffers M_DUP_PKTHDR() will leak mbuf tags.
See similar rum(4) commit for more info. OK mglocker@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ic/an.c | 12 | ||||
-rw-r--r-- | sys/dev/ic/ath.c | 13 | ||||
-rw-r--r-- | sys/dev/ic/atw.c | 12 | ||||
-rw-r--r-- | sys/dev/ic/rt2560.c | 17 | ||||
-rw-r--r-- | sys/dev/ic/rt2661.c | 17 | ||||
-rw-r--r-- | sys/dev/ic/rtw.c | 12 |
6 files changed, 48 insertions, 35 deletions
diff --git a/sys/dev/ic/an.c b/sys/dev/ic/an.c index eb62f21554f..782882e8564 100644 --- a/sys/dev/ic/an.c +++ b/sys/dev/ic/an.c @@ -1,4 +1,4 @@ -/* $OpenBSD: an.c,v 1.52 2006/06/25 18:50:51 mickey Exp $ */ +/* $OpenBSD: an.c,v 1.53 2007/01/03 18:16:43 claudio Exp $ */ /* $NetBSD: an.c,v 1.34 2005/06/20 02:49:18 atatat Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -463,11 +463,12 @@ an_rxeof(struct an_softc *sc) tap->ar_chan_flags = ic->ic_bss->ni_chan->ic_flags; - M_DUP_PKTHDR(&mb, m); mb.m_data = (caddr_t)tap; mb.m_len = sizeof(sc->sc_rxtapu); 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 /* NPBFILTER > 0 */ @@ -1192,11 +1193,12 @@ an_start(struct ifnet *ifp) tap->at_chan_flags = ic->ic_bss->ni_chan->ic_flags; - M_DUP_PKTHDR(&mb, m); mb.m_data = (caddr_t)tap; mb.m_len = sizeof(sc->sc_txtapu); 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, m, BPF_DIRECTION_OUT); } #endif diff --git a/sys/dev/ic/ath.c b/sys/dev/ic/ath.c index 0a7b020b4a8..a99e5cf017f 100644 --- a/sys/dev/ic/ath.c +++ b/sys/dev/ic/ath.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ath.c,v 1.60 2006/12/14 09:23:24 reyk Exp $ */ +/* $OpenBSD: ath.c,v 1.61 2007/01/03 18:16:43 claudio Exp $ */ /* $NetBSD: ath.c,v 1.37 2004/08/18 21:59:39 dyoung Exp $ */ /*- @@ -2018,12 +2018,12 @@ ath_rx_proc(void *arg, int npending) sc->sc_rxtap.wr_rssi = ds->ds_rxstat.rs_rssi; sc->sc_rxtap.wr_max_rssi = ic->ic_max_rssi; - M_DUP_PKTHDR(&mb, m); mb.m_data = (caddr_t)&sc->sc_rxtap; 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 @@ -2410,11 +2410,12 @@ ath_tx_start(struct ath_softc *sc, struct ieee80211_node *ni, sc->sc_txtap.wt_antenna = antenna; sc->sc_txtap.wt_hwqueue = hwqueue; - M_DUP_PKTHDR(&mb, m0); mb.m_data = (caddr_t)&sc->sc_txtap; mb.m_len = sc->sc_txtap_len; mb.m_next = m0; - 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 diff --git a/sys/dev/ic/atw.c b/sys/dev/ic/atw.c index f148b1cf91a..38ffd80784e 100644 --- a/sys/dev/ic/atw.c +++ b/sys/dev/ic/atw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: atw.c,v 1.49 2006/11/26 17:20:33 jsg Exp $ */ +/* $OpenBSD: atw.c,v 1.50 2007/01/03 18:16:43 claudio Exp $ */ /* $NetBSD: atw.c,v 1.69 2004/07/23 07:07:55 dyoung Exp $ */ /*- @@ -3210,11 +3210,12 @@ atw_rxintr(struct atw_softc *sc) tap->ar_antsignal = (int)rssi; /* TBD tap->ar_flags */ - M_DUP_PKTHDR(&mb, m); mb.m_data = (caddr_t)tap; mb.m_len = tap->ar_ihdr.it_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_radiobpf, &mb, BPF_DIRECTION_IN); } #endif /* NPBFILTER > 0 */ @@ -3551,11 +3552,12 @@ atw_start(struct ifnet *ifp) /* TBD tap->at_flags */ - M_DUP_PKTHDR(&mb, m0); mb.m_data = (caddr_t)tap; mb.m_len = tap->at_ihdr.it_len; mb.m_next = m0; - mb.m_pkthdr.len += mb.m_len; + mb.m_nextpkt = NULL; + mb.m_type = 0; + mb.m_flags = 0; bpf_mtap(sc->sc_radiobpf, &mb, BPF_DIRECTION_OUT); } #endif /* NBPFILTER > 0 */ diff --git a/sys/dev/ic/rt2560.c b/sys/dev/ic/rt2560.c index c5d327643e0..a7ce7ab893c 100644 --- a/sys/dev/ic/rt2560.c +++ b/sys/dev/ic/rt2560.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rt2560.c,v 1.29 2006/12/17 16:24:00 damien Exp $ */ +/* $OpenBSD: rt2560.c,v 1.30 2007/01/03 18:16:43 claudio Exp $ */ /*- * Copyright (c) 2005, 2006 @@ -1183,11 +1183,12 @@ rt2560_decryption_intr(struct rt2560_softc *sc) tap->wr_antenna = sc->rx_ant; tap->wr_antsignal = desc->rssi; - 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_IN); } #endif @@ -1640,11 +1641,12 @@ rt2560_tx_mgt(struct rt2560_softc *sc, struct mbuf *m0, tap->wt_chan_flags = htole16(ic->ic_ibss_chan->ic_flags); tap->wt_antenna = sc->tx_ant; - M_DUP_PKTHDR(&mb, m0); mb.m_data = (caddr_t)tap; mb.m_len = sc->sc_txtap_len; mb.m_next = m0; - 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 @@ -1870,11 +1872,12 @@ rt2560_tx_data(struct rt2560_softc *sc, struct mbuf *m0, tap->wt_chan_flags = htole16(ic->ic_ibss_chan->ic_flags); tap->wt_antenna = sc->tx_ant; - M_DUP_PKTHDR(&mb, m0); mb.m_data = (caddr_t)tap; mb.m_len = sc->sc_txtap_len; mb.m_next = m0; - 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 diff --git a/sys/dev/ic/rt2661.c b/sys/dev/ic/rt2661.c index ca383414cf8..d7fa264e9da 100644 --- a/sys/dev/ic/rt2661.c +++ b/sys/dev/ic/rt2661.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rt2661.c,v 1.34 2006/12/17 16:24:00 damien Exp $ */ +/* $OpenBSD: rt2661.c,v 1.35 2007/01/03 18:16:43 claudio Exp $ */ /*- * Copyright (c) 2006 @@ -1104,11 +1104,12 @@ rt2661_rx_intr(struct rt2661_softc *sc) tap->wr_chan_flags = htole16(sc->sc_curchan->ic_flags); tap->wr_antsignal = desc->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 @@ -1489,11 +1490,12 @@ rt2661_tx_mgt(struct rt2661_softc *sc, struct mbuf *m0, tap->wt_chan_freq = htole16(sc->sc_curchan->ic_freq); tap->wt_chan_flags = htole16(sc->sc_curchan->ic_flags); - M_DUP_PKTHDR(&mb, m0); mb.m_data = (caddr_t)tap; mb.m_len = sc->sc_txtap_len; mb.m_next = m0; - 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 @@ -1714,11 +1716,12 @@ rt2661_tx_data(struct rt2661_softc *sc, struct mbuf *m0, tap->wt_chan_freq = htole16(sc->sc_curchan->ic_freq); tap->wt_chan_flags = htole16(sc->sc_curchan->ic_flags); - M_DUP_PKTHDR(&mb, m0); mb.m_data = (caddr_t)tap; mb.m_len = sc->sc_txtap_len; mb.m_next = m0; - 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 diff --git a/sys/dev/ic/rtw.c b/sys/dev/ic/rtw.c index 8381bfd63fa..f18d32ea2d8 100644 --- a/sys/dev/ic/rtw.c +++ b/sys/dev/ic/rtw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtw.c,v 1.56 2006/11/26 17:20:33 jsg Exp $ */ +/* $OpenBSD: rtw.c,v 1.57 2007/01/03 18:16:43 claudio Exp $ */ /* $NetBSD: rtw.c,v 1.29 2004/12/27 19:49:16 dyoung Exp $ */ /*- @@ -1329,11 +1329,12 @@ rtw_intr_rx(struct rtw_softc *sc, u_int16_t isr) rr->rr_antsignal = rssi; rr->rr_barker_lock = htole16(sq); - M_DUP_PKTHDR(&mb, m); mb.m_data = (caddr_t)rr; mb.m_len = sizeof(sc->sc_rxtapu); 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_radiobpf, &mb, BPF_DIRECTION_IN); } #endif /* NPBFILTER > 0 */ @@ -3079,11 +3080,12 @@ rtw_start(struct ifnet *ifp) rt->rt_chan_flags = htole16(ic->ic_bss->ni_chan->ic_flags); - M_DUP_PKTHDR(&mb, m0); mb.m_data = (caddr_t)rt; mb.m_len = sizeof(sc->sc_txtapu); mb.m_next = m0; - mb.m_pkthdr.len += mb.m_len; + mb.m_nextpkt = NULL; + mb.m_type = 0; + mb.m_flags = 0; bpf_mtap(sc->sc_radiobpf, &mb, BPF_DIRECTION_OUT); } |