]> Git Repo - linux.git/commitdiff
mac80211: fix setting IEEE80211_KEY_FLAG_RX_MGMT for AP mode keys
authorFelix Fietkau <[email protected]>
Sat, 29 Sep 2018 14:01:58 +0000 (16:01 +0200)
committerJohannes Berg <[email protected]>
Mon, 1 Oct 2018 07:13:48 +0000 (09:13 +0200)
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")
Cc: [email protected]
Signed-off-by: Felix Fietkau <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>
net/mac80211/cfg.c

index d25da0e66da16218c340e4c7f8a9aaf663985b9c..5d22eda8a6b1e9d4f8d6f45c1c8c633a892041d3 100644 (file)
@@ -427,7 +427,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:
This page took 0.050382 seconds and 4 git commands to generate.