diff options
author | sam <sam@FreeBSD.org> | 2005-08-10 17:42:13 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2005-08-10 17:42:13 +0000 |
commit | 68a0fee0bb6cf21c068641cdd952932f7d2e8cf3 (patch) | |
tree | b27c9fe6e2e4e633f02ab386c87d618edc22950a /sys | |
parent | c9a2728833c21511e853b6ce133a7d3f3721aec3 (diff) | |
download | FreeBSD-src-68a0fee0bb6cf21c068641cdd952932f7d2e8cf3.zip FreeBSD-src-68a0fee0bb6cf21c068641cdd952932f7d2e8cf3.tar.gz |
Don't use ic_curmode to decide when to do 11g station accounting,
use the station channel properties. Fixes assert failure/bogus
operation when an ap is operating in 11a and has associated stations
then switches to 11g.
Noticed by: Michal Mertl
Reviewed by: avatar
MFC after: 2 weeks
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net80211/_ieee80211.h | 2 | ||||
-rw-r--r-- | sys/net80211/ieee80211_node.c | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/sys/net80211/_ieee80211.h b/sys/net80211/_ieee80211.h index 1f369c4..24da6ff 100644 --- a/sys/net80211/_ieee80211.h +++ b/sys/net80211/_ieee80211.h @@ -152,6 +152,8 @@ struct ieee80211_channel { (((_c)->ic_flags & IEEE80211_CHAN_PUREG) == IEEE80211_CHAN_PUREG) #define IEEE80211_IS_CHAN_G(_c) \ (((_c)->ic_flags & IEEE80211_CHAN_G) == IEEE80211_CHAN_G) +#define IEEE80211_IS_CHAN_ANYG(_c) \ + (IEEE80211_IS_CHAN_PUREG(_c) || IEEE80211_IS_CHAN_G(_c)) #define IEEE80211_IS_CHAN_T(_c) \ (((_c)->ic_flags & IEEE80211_CHAN_T) == IEEE80211_CHAN_T) #define IEEE80211_IS_CHAN_108G(_c) \ diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index dc098a0..eca1241 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -2062,9 +2062,9 @@ static void ieee80211_node_leave_11g(struct ieee80211com *ic, struct ieee80211_node *ni) { - KASSERT(ic->ic_curmode == IEEE80211_MODE_11G || - ic->ic_curmode == IEEE80211_MODE_TURBO_G, - ("not in 11g, curmode %x", ic->ic_curmode)); + KASSERT(IEEE80211_IS_CHAN_ANYG(ni->ni_chan), + ("not in 11g, bss %u:0x%x, curmode %u", ni->ni_chan->ic_freq, + ni->ni_chan->ic_flags, ic->ic_curmode)); /* * If a long slot station do the slot time bookkeeping. @@ -2152,8 +2152,7 @@ ieee80211_node_leave(struct ieee80211com *ic, struct ieee80211_node *ni) ni->ni_associd = 0; ic->ic_sta_assoc--; - if (ic->ic_curmode == IEEE80211_MODE_11G || - ic->ic_curmode == IEEE80211_MODE_TURBO_G) + if (IEEE80211_IS_CHAN_ANYG(ic->ic_bss->ni_chan)) ieee80211_node_leave_11g(ic, ni); /* * Cleanup station state. In particular clear various |