summaryrefslogtreecommitdiffstats
path: root/sys/dev/ral/rt2560.c
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2009-05-29 23:41:31 +0000
committersam <sam@FreeBSD.org>2009-05-29 23:41:31 +0000
commit36bf6c9b02de093f113d81dc2ba7c54d7ba93926 (patch)
tree9787d1f6e3cc4539910d1507c1a24f4aee473ecf /sys/dev/ral/rt2560.c
parenta025c3b40e2c37699d82b576a11975bb3c4c06c3 (diff)
downloadFreeBSD-src-36bf6c9b02de093f113d81dc2ba7c54d7ba93926.zip
FreeBSD-src-36bf6c9b02de093f113d81dc2ba7c54d7ba93926.tar.gz
validate tx rate(s) in the raw xmit path
Tested by: "Paul B. Mahol" <onemda@gmail.com> (rum, bwi)
Diffstat (limited to 'sys/dev/ral/rt2560.c')
-rw-r--r--sys/dev/ral/rt2560.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/ral/rt2560.c b/sys/dev/ral/rt2560.c
index 95c5ebd..7bb785c 100644
--- a/sys/dev/ral/rt2560.c
+++ b/sys/dev/ral/rt2560.c
@@ -1715,6 +1715,7 @@ rt2560_tx_raw(struct rt2560_softc *sc, struct mbuf *m0,
struct ieee80211_node *ni, const struct ieee80211_bpf_params *params)
{
struct ieee80211vap *vap = ni->ni_vap;
+ struct ieee80211com *ic = ni->ni_ic;
struct rt2560_tx_desc *desc;
struct rt2560_tx_data *data;
bus_dma_segment_t segs[RT2560_MAX_SCATTER];
@@ -1724,9 +1725,8 @@ rt2560_tx_raw(struct rt2560_softc *sc, struct mbuf *m0,
desc = &sc->prioq.desc[sc->prioq.cur];
data = &sc->prioq.data[sc->prioq.cur];
- rate = params->ibp_rate0 & IEEE80211_RATE_VAL;
- /* XXX validate */
- if (rate == 0) {
+ rate = params->ibp_rate0;
+ if (!ieee80211_isratevalid(ic->ic_rt, rate)) {
/* XXX fall back to mcast/mgmt rate? */
m_freem(m0);
return EINVAL;
OpenPOWER on IntegriCloud