diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-05-12 14:47:32 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-05-13 15:44:48 -0400 |
commit | e0d61887c2ee19bb63f6a8c0e2c149184e879501 (patch) | |
tree | 29b5a55ae747b0ea2e7446e2029e1d1ff268e38a /net/mac80211/ibss.c | |
parent | e0502de6fe85b66ee51647eb75bc5af3c885d712 (diff) |
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: 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.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c index aa537681f87c..c94a695d8488 100644 --- a/net/mac80211/ibss.c +++ b/net/mac80211/ibss.c | |||
@@ -499,6 +499,7 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata) | |||
499 | struct ieee80211_channel *chan = NULL; | 499 | struct ieee80211_channel *chan = NULL; |
500 | const u8 *bssid = NULL; | 500 | const u8 *bssid = NULL; |
501 | int active_ibss; | 501 | int active_ibss; |
502 | u16 capability; | ||
502 | 503 | ||
503 | active_ibss = ieee80211_sta_active_ibss(sdata); | 504 | active_ibss = ieee80211_sta_active_ibss(sdata); |
504 | #ifdef CONFIG_MAC80211_IBSS_DEBUG | 505 | #ifdef CONFIG_MAC80211_IBSS_DEBUG |
@@ -509,6 +510,10 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata) | |||
509 | if (active_ibss) | 510 | if (active_ibss) |
510 | return; | 511 | return; |
511 | 512 | ||
513 | capability = WLAN_CAPABILITY_IBSS; | ||
514 | if (sdata->default_key) | ||
515 | capability |= WLAN_CAPABILITY_PRIVACY; | ||
516 | |||
512 | if (ifibss->fixed_bssid) | 517 | if (ifibss->fixed_bssid) |
513 | bssid = ifibss->bssid; | 518 | bssid = ifibss->bssid; |
514 | if (ifibss->fixed_channel) | 519 | if (ifibss->fixed_channel) |
@@ -517,8 +522,9 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata) | |||
517 | bssid = ifibss->bssid; | 522 | bssid = ifibss->bssid; |
518 | bss = (void *)cfg80211_get_bss(local->hw.wiphy, chan, bssid, | 523 | bss = (void *)cfg80211_get_bss(local->hw.wiphy, chan, bssid, |
519 | ifibss->ssid, ifibss->ssid_len, | 524 | ifibss->ssid, ifibss->ssid_len, |
520 | WLAN_CAPABILITY_IBSS, | 525 | capability, |
521 | WLAN_CAPABILITY_IBSS); | 526 | WLAN_CAPABILITY_IBSS | |
527 | WLAN_CAPABILITY_PRIVACY); | ||
522 | 528 | ||
523 | #ifdef CONFIG_MAC80211_IBSS_DEBUG | 529 | #ifdef CONFIG_MAC80211_IBSS_DEBUG |
524 | if (bss) | 530 | if (bss) |