diff options
author | sam <sam@FreeBSD.org> | 2007-03-11 06:55:59 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2007-03-11 06:55:59 +0000 |
commit | f159bf3ace0da75328bc22d218c119bf4798493f (patch) | |
tree | 05af121831cb0b8de689089e6730f787d6e8551d /sys/net80211 | |
parent | 4d8126d1b73402521b814aa74e392053c3a4db28 (diff) | |
download | FreeBSD-src-f159bf3ace0da75328bc22d218c119bf4798493f.zip FreeBSD-src-f159bf3ace0da75328bc22d218c119bf4798493f.tar.gz |
split check for rate set mismatch on assoc req away from check
for pure 11g mode so we can give meaningful diagnostic msgs
MFC after: 2 weeks
Diffstat (limited to 'sys/net80211')
-rw-r--r-- | sys/net80211/ieee80211_input.c | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c index cfe106e..19a9b8b 100644 --- a/sys/net80211/ieee80211_input.c +++ b/sys/net80211/ieee80211_input.c @@ -1774,6 +1774,21 @@ ieee80211_deliver_l2uf(struct ieee80211_node *ni) } static void +ratesetmismatch(struct ieee80211_node *ni, const struct ieee80211_frame *wh, + int reassoc, int resp, const char *tag, int rate) +{ + struct ieee80211com *ic = ni->ni_ic; + + IEEE80211_DPRINTF(ic, IEEE80211_MSG_ANY, + "[%s] deny %s request, %srate set mismatch, rate 0x%x\n", + ether_sprintf(wh->i_addr2), + reassoc ? "reassoc" : "assoc", tag, rate); + IEEE80211_SEND_MGMT(ic, ni, resp, IEEE80211_STATUS_BASIC_RATE); + ieee80211_node_leave(ic, ni); + ic->ic_stats.is_rx_assoc_norate++; +} + +static void capinfomismatch(struct ieee80211_node *ni, const struct ieee80211_frame *wh, int reassoc, int resp, const char *tag, int capinfo) { @@ -2378,22 +2393,18 @@ ieee80211_recv_mgmt(struct ieee80211com *ic, struct mbuf *m0, rate = ieee80211_setup_rates(ni, rates, xrates, IEEE80211_F_DOSORT | IEEE80211_F_DOFRATE | IEEE80211_F_DONEGO | IEEE80211_F_DODEL); + if (rate & IEEE80211_RATE_BASIC) { + ratesetmismatch(ni, wh, reassoc, resp, "basic", rate); + return; + } /* * If constrained to 11g-only stations reject an * 11b-only station. We cheat a bit here by looking * at the max negotiated xmit rate and assuming anyone * with a best rate <24Mb/s is an 11b station. */ - if ((rate & IEEE80211_RATE_BASIC) || - ((ic->ic_flags & IEEE80211_F_PUREG) && rate < 48)) { - IEEE80211_DPRINTF(ic, IEEE80211_MSG_ANY, - "[%s] deny %s request, rate set mismatch\n", - ether_sprintf(wh->i_addr2), - reassoc ? "reassoc" : "assoc"); - IEEE80211_SEND_MGMT(ic, ni, resp, - IEEE80211_STATUS_BASIC_RATE); - ieee80211_node_leave(ic, ni); - ic->ic_stats.is_rx_assoc_norate++; + if ((ic->ic_flags & IEEE80211_F_PUREG) && rate < 48) { + ratesetmismatch(ni, wh, reassoc, resp, "11g", rate); return; } ni->ni_rssi = rssi; |