diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 9e91b4f478432fd84b667dbeb0e4101e9fb0b7f5..972109f06a70a79d7465f42f5879485efde03dec 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -2987,6 +2987,10 @@ void ieee80211_sta_block_awake(struct ieee80211_hw *hw, * needs reprogramming of the keys during suspend. Note that due * to locking reasons, it is also only safe to call this at few * spots since it must hold the RTNL and be able to sleep. + * + * The order in which the keys are iterated matches the order + * in which they were originally installed and handed to the + * set_key callback. */ void ieee80211_iter_keys(struct ieee80211_hw *hw, struct ieee80211_vif *vif, diff --git a/net/mac80211/key.c b/net/mac80211/key.c index 739bee13e813d6a59619155fc2498ec7e650abab..5150c6d11b57bc728eae5bedfa0897d7c3343ec5 100644 --- a/net/mac80211/key.c +++ b/net/mac80211/key.c @@ -278,7 +278,7 @@ static void __ieee80211_key_replace(struct ieee80211_sub_if_data *sdata, bool defunikey, defmultikey, defmgmtkey; if (new) - list_add(&new->list, &sdata->key_list); + list_add_tail(&new->list, &sdata->key_list); if (sta && pairwise) { rcu_assign_pointer(sta->ptk, new);