Skip to content

Commit

Permalink
mac80211: deinitialize ibss-internals after emptiness check
Browse files Browse the repository at this point in the history
The check whether the IBSS is active and can be removed should be
performed before deinitializing the fields used for the check/search.
Otherwise, the configured BSS will not be found and removed properly.

To make it more clear for the future, rename sdata->u.ibss to the
local pointer ifibss which is used within the checks.

This behaviour was introduced by
f3209be
("mac80211: fix IBSS teardown race")

Cc: stable@vger.kernel.org
Cc: Ignacy Gawedzki <i@lri.fr>
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Simon Wunderlich authored and Johannes Berg committed Nov 13, 2012
1 parent 43c771a commit b78a493
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions net/mac80211/ibss.c
Original file line number Diff line number Diff line change
Expand Up @@ -1151,10 +1151,6 @@ int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata)

mutex_lock(&sdata->u.ibss.mtx);

sdata->u.ibss.state = IEEE80211_IBSS_MLME_SEARCH;
memset(sdata->u.ibss.bssid, 0, ETH_ALEN);
sdata->u.ibss.ssid_len = 0;

active_ibss = ieee80211_sta_active_ibss(sdata);

if (!active_ibss && !is_zero_ether_addr(ifibss->bssid)) {
Expand All @@ -1175,6 +1171,10 @@ int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata)
}
}

ifibss->state = IEEE80211_IBSS_MLME_SEARCH;
memset(ifibss->bssid, 0, ETH_ALEN);
ifibss->ssid_len = 0;

sta_info_flush(sdata->local, sdata);

spin_lock_bh(&ifibss->incomplete_lock);
Expand Down

0 comments on commit b78a493

Please sign in to comment.