From 0ad5382f7778c215bfa1b8fda30059c015810ab9 Mon Sep 17 00:00:00 2001 From: sam Date: Tue, 15 Nov 2005 05:47:20 +0000 Subject: bandaid inconsistent state handling: the rate index map may be stale when called to reset rate control state causing us to pickup an invalid index, check for this and skip 'em (things will eventually get fixed up so this is not harmful) --- sys/dev/ath/ath_rate/sample/sample.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/dev/ath/ath_rate/sample/sample.c b/sys/dev/ath/ath_rate/sample/sample.c index 7acdc5c..f7b2920 100644 --- a/sys/dev/ath/ath_rate/sample/sample.c +++ b/sys/dev/ath/ath_rate/sample/sample.c @@ -710,6 +710,11 @@ ath_rate_ctl_reset(struct ath_softc *sc, struct ieee80211_node *ni) for (x = 0; x < ni->ni_rates.rs_nrates; x++) { sn->rates[x].rate = ni->ni_rates.rs_rates[x] & IEEE80211_RATE_VAL; sn->rates[x].rix = sc->sc_rixmap[sn->rates[x].rate]; + if (sn->rates[x].rix == 0xff) { + DPRINTF(sc, "%s: ignore bogus rix at %d\n", + __func__, x); + continue; + } sn->rates[x].rateCode = rt->info[sn->rates[x].rix].rateCode; sn->rates[x].shortPreambleRateCode = rt->info[sn->rates[x].rix].rateCode | -- cgit v1.1