aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2018-09-29 16:01:58 +0200
committerMoyster <oysterized@gmail.com>2019-05-03 19:24:03 +0200
commitea6ffce4ebbbde90e9d81fa8052d7098474531d8 (patch)
treec20b706f1bd305f6f26666d9f99cd456152c3381 /net
parent15bb1d39066d670d126224bb09f40f66d6935c0e (diff)
mac80211: fix setting IEEE80211_KEY_FLAG_RX_MGMT for AP mode keys
commit 211710ca74adf790b46ab3867fcce8047b573cd1 upstream. key->sta is only valid after ieee80211_key_link, which is called later in this function. Because of that, the IEEE80211_KEY_FLAG_RX_MGMT is never set when management frame protection is enabled. Fixes: e548c49e6dc6b ("mac80211: add key flag for management keys") Change-Id: I68369a1a0ed2646246f47bf1cb286e51e0538d0a Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/cfg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 11a10d580..62584c31d 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -189,7 +189,7 @@ static int ieee80211_add_key(struct wiphy *wiphy, struct net_device *dev,
case NL80211_IFTYPE_AP:
case NL80211_IFTYPE_AP_VLAN:
/* Keys without a station are used for TX only */
- if (key->sta && test_sta_flag(key->sta, WLAN_STA_MFP))
+ if (sta && test_sta_flag(sta, WLAN_STA_MFP))
key->conf.flags |= IEEE80211_KEY_FLAG_RX_MGMT;
break;
case NL80211_IFTYPE_ADHOC: