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/ic/rt2560.c | |
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/ic/rt2560.c')
-rw-r--r-- | sys/dev/ic/rt2560.c | 17 |
1 files changed, 10 insertions, 7 deletions
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 |