From 68a0fee0bb6cf21c068641cdd952932f7d2e8cf3 Mon Sep 17 00:00:00 2001 From: sam Date: Wed, 10 Aug 2005 17:42:13 +0000 Subject: 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 --- sys/net80211/ieee80211_node.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'sys/net80211/ieee80211_node.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 -- cgit v1.1