From 49d4c02f30589a4a175cc5ad63483bf04a3852cb Mon Sep 17 00:00:00 2001 From: Sam Leffler Date: Fri, 10 Jun 2005 01:31:28 +0000 Subject: [PATCH] correct checks for rate set compatibility --- sys/net80211/ieee80211_input.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c index 2e21b1a21844..23271d0b29ee 100644 --- a/sys/net80211/ieee80211_input.c +++ b/sys/net80211/ieee80211_input.c @@ -1674,6 +1674,7 @@ ieee80211_recv_mgmt(struct ieee80211com *ic, struct mbuf *m0, u_int8_t *frm, *efrm; u_int8_t *ssid, *rates, *xrates, *wpa, *wme; int reassoc, resp, allocbs; + u_int8_t rate; wh = mtod(m0, struct ieee80211_frame *); frm = (u_int8_t *)&wh[1]; @@ -1969,9 +1970,7 @@ ieee80211_recv_mgmt(struct ieee80211com *ic, struct mbuf *m0, break; } - case IEEE80211_FC0_SUBTYPE_PROBE_REQ: { - u_int8_t rate; - + case IEEE80211_FC0_SUBTYPE_PROBE_REQ: if (ic->ic_opmode == IEEE80211_M_STA || ic->ic_state != IEEE80211_S_RUN) { ic->ic_stats.is_rx_mgtdiscard++; @@ -2054,7 +2053,6 @@ ieee80211_recv_mgmt(struct ieee80211com *ic, struct mbuf *m0, ieee80211_free_node(ni); } break; - } case IEEE80211_FC0_SUBTYPE_AUTH: { u_int16_t algo, seq, status; @@ -2268,10 +2266,10 @@ ieee80211_recv_mgmt(struct ieee80211com *ic, struct mbuf *m0, ic->ic_stats.is_rx_assoc_capmismatch++; return; } - ieee80211_setup_rates(ic, ni, rates, xrates, + rate = ieee80211_setup_rates(ic, ni, rates, xrates, IEEE80211_F_DOSORT | IEEE80211_F_DOFRATE | IEEE80211_F_DONEGO | IEEE80211_F_DODEL); - if (ni->ni_rates.rs_nrates == 0) { + if (rate & IEEE80211_RATE_BASIC) { IEEE80211_DPRINTF(ic, IEEE80211_MSG_ANY, "[%s] deny %s request, rate set mismatch\n", ether_sprintf(wh->i_addr2), @@ -2382,10 +2380,10 @@ ieee80211_recv_mgmt(struct ieee80211com *ic, struct mbuf *m0, } IEEE80211_VERIFY_ELEMENT(rates, IEEE80211_RATE_MAXSIZE); - ieee80211_setup_rates(ic, ni, rates, xrates, + rate = ieee80211_setup_rates(ic, ni, rates, xrates, IEEE80211_F_DOSORT | IEEE80211_F_DOFRATE | IEEE80211_F_DONEGO | IEEE80211_F_DODEL); - if (ni->ni_rates.rs_nrates == 0) { + if (rate & IEEE80211_RATE_BASIC) { IEEE80211_DPRINTF(ic, IEEE80211_MSG_ASSOC, "[%s] %sassoc failed (rate set mismatch)\n", ether_sprintf(wh->i_addr2),