diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2006-12-30 22:43:02 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2006-12-30 22:43:02 +0000 |
commit | 631e97bb25e5dc9cfda3af9cba2b2679c10084fe (patch) | |
tree | 14c93a04ddfb945175ffd923ba827977102ff174 /sys/dev/ic/pgt.c | |
parent | 176ba5afb38ff8c1af0458556877f76175414932 (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/pgt.c')
-rw-r--r-- | sys/dev/ic/pgt.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/dev/ic/pgt.c b/sys/dev/ic/pgt.c index 9e8376b3524..80030ef9b6a 100644 --- a/sys/dev/ic/pgt.c +++ b/sys/dev/ic/pgt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pgt.c,v 1.39 2006/12/07 23:50:10 mglocker Exp $ */ +/* $OpenBSD: pgt.c,v 1.40 2006/12/30 22:43:01 claudio Exp $ */ /* * Copyright (c) 2006 Claudio Jeker <claudio@openbsd.org> @@ -1022,12 +1022,12 @@ input: tap->wr_rssi = rssi; 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 @@ -2231,11 +2231,12 @@ pgt_start(struct ifnet *ifp) htole16(ic->ic_bss->ni_chan->ic_flags); if (m != NULL) { - 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); |