diff options
author | sam <sam@FreeBSD.org> | 2009-05-29 23:41:31 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2009-05-29 23:41:31 +0000 |
commit | 36bf6c9b02de093f113d81dc2ba7c54d7ba93926 (patch) | |
tree | 9787d1f6e3cc4539910d1507c1a24f4aee473ecf /sys/dev/bwi | |
parent | a025c3b40e2c37699d82b576a11975bb3c4c06c3 (diff) | |
download | FreeBSD-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/bwi')
-rw-r--r-- | sys/dev/bwi/if_bwi.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/sys/dev/bwi/if_bwi.c b/sys/dev/bwi/if_bwi.c index 48580a5..a7cc732 100644 --- a/sys/dev/bwi/if_bwi.c +++ b/sys/dev/bwi/if_bwi.c @@ -3126,6 +3126,7 @@ bwi_encap_raw(struct bwi_softc *sc, int idx, struct mbuf *m, { struct ifnet *ifp = sc->sc_ifp; struct ieee80211vap *vap = ni->ni_vap; + struct ieee80211com *ic = ni->ni_ic; struct bwi_ring_data *rd = &sc->sc_tx_rdata[BWI_TX_DATA_RING]; struct bwi_txbuf_data *tbd = &sc->sc_tx_bdata[BWI_TX_DATA_RING]; struct bwi_txbuf *tb = &tbd->tbd_buf[idx]; @@ -3152,8 +3153,20 @@ bwi_encap_raw(struct bwi_softc *sc, int idx, struct mbuf *m, * Find TX rate */ rate = params->ibp_rate0; - rate_fb = (params->ibp_try1 != 0) ? - params->ibp_rate1 : params->ibp_rate0; + if (!ieee80211_isratevalid(ic->ic_rt, rate)) { + /* XXX fall back to mcast/mgmt rate? */ + m_freem(m0); + return EINVAL; + } + if (params->ibp_try1 != 0) { + rate_fb = params->ibp_rate1; + if (!ieee80211_isratevalid(ic->ic_rt, rate_fb)) { + /* XXX fall back to rate0? */ + m_freem(m0); + return EINVAL; + } + } else + rate_fb = rate; tb->tb_rate[0] = rate; tb->tb_rate[1] = rate_fb; sc->sc_tx_rate = rate; |