diff options
Diffstat (limited to 'net/mac80211/ieee80211_sta.c')
| -rw-r--r-- | net/mac80211/ieee80211_sta.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c index fda0e06453e8..2079e988fc56 100644 --- a/net/mac80211/ieee80211_sta.c +++ b/net/mac80211/ieee80211_sta.c | |||
| @@ -704,10 +704,11 @@ static int ieee80211_privacy_mismatch(struct net_device *dev, | |||
| 704 | { | 704 | { |
| 705 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); | 705 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); |
| 706 | struct ieee80211_sta_bss *bss; | 706 | struct ieee80211_sta_bss *bss; |
| 707 | int res = 0; | 707 | int bss_privacy; |
| 708 | int wep_privacy; | ||
| 709 | int privacy_invoked; | ||
| 708 | 710 | ||
| 709 | if (!ifsta || (ifsta->flags & IEEE80211_STA_MIXED_CELL) || | 711 | if (!ifsta || (ifsta->flags & IEEE80211_STA_MIXED_CELL)) |
| 710 | ifsta->key_management_enabled) | ||
| 711 | return 0; | 712 | return 0; |
| 712 | 713 | ||
| 713 | bss = ieee80211_rx_bss_get(dev, ifsta->bssid, local->hw.conf.channel, | 714 | bss = ieee80211_rx_bss_get(dev, ifsta->bssid, local->hw.conf.channel, |
| @@ -715,13 +716,16 @@ static int ieee80211_privacy_mismatch(struct net_device *dev, | |||
| 715 | if (!bss) | 716 | if (!bss) |
| 716 | return 0; | 717 | return 0; |
| 717 | 718 | ||
| 718 | if (ieee80211_sta_wep_configured(dev) != | 719 | bss_privacy = !!(bss->capability & WLAN_CAPABILITY_PRIVACY); |
| 719 | !!(bss->capability & WLAN_CAPABILITY_PRIVACY)) | 720 | wep_privacy = !!ieee80211_sta_wep_configured(dev); |
| 720 | res = 1; | 721 | privacy_invoked = !!(ifsta->flags & IEEE80211_STA_PRIVACY_INVOKED); |
| 721 | 722 | ||
| 722 | ieee80211_rx_bss_put(dev, bss); | 723 | ieee80211_rx_bss_put(dev, bss); |
| 723 | 724 | ||
| 724 | return res; | 725 | if ((bss_privacy == wep_privacy) || (bss_privacy == privacy_invoked)) |
| 726 | return 0; | ||
| 727 | |||
| 728 | return 1; | ||
| 725 | } | 729 | } |
| 726 | 730 | ||
| 727 | 731 | ||
