diff options
author | 2007-01-02 14:43:50 +0000 | |
---|---|---|
committer | 2007-01-02 14:43:50 +0000 | |
commit | dd2e8b0230537cd45eb8a2e78749b5675ea645aa (patch) | |
tree | dbc70c2b9ab8629e527d999ce1a62e9d370e1fd3 /sys/dev/usb/if_ral.c | |
parent | skeletons for the client-side part of the editors and watchers commands. (diff) | |
download | wireguard-openbsd-dd2e8b0230537cd45eb8a2e78749b5675ea645aa.tar.xz wireguard-openbsd-dd2e8b0230537cd45eb8a2e78749b5675ea645aa.zip |
Don't use M_DUP_PKTHDR() in the driver bpf hook. Using M_DUP_PKTHDR() on a
static mbuf results in a mbuf tag memory leak. Same change as in rum(4).
OK mglocker@
Diffstat (limited to 'sys/dev/usb/if_ral.c')
-rw-r--r-- | sys/dev/usb/if_ral.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/dev/usb/if_ral.c b/sys/dev/usb/if_ral.c index dd2faab4e4a..3e5da8453e6 100644 --- a/sys/dev/usb/if_ral.c +++ b/sys/dev/usb/if_ral.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ral.c,v 1.87 2006/12/07 17:32:19 damien Exp $ */ +/* $OpenBSD: if_ral.c,v 1.88 2007/01/02 14:43:50 claudio Exp $ */ /*- * Copyright (c) 2005, 2006 @@ -781,11 +781,12 @@ ural_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) 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_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 @@ -1176,11 +1177,12 @@ ural_tx_data(struct ural_softc *sc, struct mbuf *m0, struct ieee80211_node *ni) tap->wt_chan_flags = htole16(ic->ic_bss->ni_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 |