]> git.karo-electronics.de Git - linux-beck.git/commitdiff
mac80211: read station mgmt keys via get_key call
authorMax Stepanov <Max.Stepanov@intel.com>
Sun, 8 Dec 2013 11:31:29 +0000 (13:31 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 16 Dec 2013 14:10:18 +0000 (15:10 +0100)
Allow to read management keys stored in a station's gtk key
array with a get_key function.

Signed-off-by: Max Stepanov <Max.Stepanov@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/cfg.c

index 0962c77f013e4adeba562319312c4f58c189299e..ac185286842d67de981da089b07edcde0ccaf87f 100644 (file)
@@ -303,7 +303,8 @@ static int ieee80211_get_key(struct wiphy *wiphy, struct net_device *dev,
 
                if (pairwise && key_idx < NUM_DEFAULT_KEYS)
                        key = rcu_dereference(sta->ptk[key_idx]);
-               else if (!pairwise && key_idx < NUM_DEFAULT_KEYS)
+               else if (!pairwise &&
+                        key_idx < NUM_DEFAULT_KEYS + NUM_DEFAULT_MGMT_KEYS)
                        key = rcu_dereference(sta->gtk[key_idx]);
        } else
                key = rcu_dereference(sdata->keys[key_idx]);