aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/ibss.c
diff options
context:
space:
mode:
authorTeemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>2010-06-14 05:55:33 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-06-14 15:39:34 -0400
commit5ea096c0c85e80335889539899af9a4717976e0b (patch)
treee04e357b3222083a2f3eef7216f8184239023c70 /net/mac80211/ibss.c
parent392cfdb10dab6c7dfa5fed18d8a44d7453d42196 (diff)
mac80211: remove BSS from cfg80211 list when leaving IBSS
Remove BSS from cfg80211 BSS list if we are only member in IBSS when leaving it. Signed-off-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/ibss.c')
-rw-r--r--net/mac80211/ibss.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 93481eb51d24..d4e84b22a66d 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -917,6 +917,31 @@ int ieee80211_ibss_join(struct ieee80211_sub_if_data *sdata,
917int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata) 917int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata)
918{ 918{
919 struct sk_buff *skb; 919 struct sk_buff *skb;
920 struct ieee80211_if_ibss *ifibss = &sdata->u.ibss;
921 struct ieee80211_local *local = sdata->local;
922 struct cfg80211_bss *cbss;
923 u16 capability;
924 int active_ibss = 0;
925
926 active_ibss = ieee80211_sta_active_ibss(sdata);
927
928 if (!active_ibss && !is_zero_ether_addr(ifibss->bssid)) {
929 capability = WLAN_CAPABILITY_IBSS;
930
931 if (ifibss->privacy)
932 capability |= WLAN_CAPABILITY_PRIVACY;
933
934 cbss = cfg80211_get_bss(local->hw.wiphy, ifibss->channel,
935 ifibss->bssid, ifibss->ssid,
936 ifibss->ssid_len, WLAN_CAPABILITY_IBSS |
937 WLAN_CAPABILITY_PRIVACY,
938 capability);
939
940 if (cbss) {
941 cfg80211_unlink_bss(local->hw.wiphy, cbss);
942 cfg80211_put_bss(cbss);
943 }
944 }
920 945
921 del_timer_sync(&sdata->u.ibss.timer); 946 del_timer_sync(&sdata->u.ibss.timer);
922 clear_bit(IEEE80211_IBSS_REQ_RUN, &sdata->u.ibss.request); 947 clear_bit(IEEE80211_IBSS_REQ_RUN, &sdata->u.ibss.request);