Commit e0d61887 authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville
Browse files

mac80211: don't connect to IBSS network with different privacy



Even when we find an IBSS with the SSID we're looking for, we
may not be able to connect to it because it has a key and we
don't, or vice versa. Avoid such situations by checking the
privacy capability bit.
Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent e0502de6
...@@ -499,6 +499,7 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata) ...@@ -499,6 +499,7 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata)
struct ieee80211_channel *chan = NULL; struct ieee80211_channel *chan = NULL;
const u8 *bssid = NULL; const u8 *bssid = NULL;
int active_ibss; int active_ibss;
u16 capability;
active_ibss = ieee80211_sta_active_ibss(sdata); active_ibss = ieee80211_sta_active_ibss(sdata);
#ifdef CONFIG_MAC80211_IBSS_DEBUG #ifdef CONFIG_MAC80211_IBSS_DEBUG
...@@ -509,6 +510,10 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata) ...@@ -509,6 +510,10 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata)
if (active_ibss) if (active_ibss)
return; return;
capability = WLAN_CAPABILITY_IBSS;
if (sdata->default_key)
capability |= WLAN_CAPABILITY_PRIVACY;
if (ifibss->fixed_bssid) if (ifibss->fixed_bssid)
bssid = ifibss->bssid; bssid = ifibss->bssid;
if (ifibss->fixed_channel) if (ifibss->fixed_channel)
...@@ -517,8 +522,9 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata) ...@@ -517,8 +522,9 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata)
bssid = ifibss->bssid; bssid = ifibss->bssid;
bss = (void *)cfg80211_get_bss(local->hw.wiphy, chan, bssid, bss = (void *)cfg80211_get_bss(local->hw.wiphy, chan, bssid,
ifibss->ssid, ifibss->ssid_len, ifibss->ssid, ifibss->ssid_len,
WLAN_CAPABILITY_IBSS, capability,
WLAN_CAPABILITY_IBSS); WLAN_CAPABILITY_IBSS |
WLAN_CAPABILITY_PRIVACY);
#ifdef CONFIG_MAC80211_IBSS_DEBUG #ifdef CONFIG_MAC80211_IBSS_DEBUG
if (bss) if (bss)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment