wifi: iwlwifi: mvm: skip keys of other links
authorShaul Triebitz <shaul.triebitz@intel.com>
Mon, 11 Mar 2024 06:28:08 +0000 (08:28 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 25 Mar 2024 14:36:03 +0000 (15:36 +0100)
When waking up from wowlan, we iterate over the current
keys and remove those that were rekeyed.
With MLO, there might be keys of other links which should
not be removed.
Skip MLO keys on other links (other than the wowlan
active link).

Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240311081938.fdf527b50d61.I605a971d2d68107769dd363b896b471998259e64@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/d3.c

index cfbfa8e7040d8fb22617913d906dc524b77145a1..06518316921f77cf6fc2c6aebbe2767e31e79f76 100644 (file)
@@ -1829,6 +1829,10 @@ static void iwl_mvm_d3_find_last_keys(struct ieee80211_hw *hw,
                                      void *_data)
 {
        struct iwl_mvm_d3_gtk_iter_data *data = _data;
+       int link_id = vif->active_links ? __ffs(vif->active_links) : -1;
+
+       if (link_id >= 0 && key->link_id >= 0 && link_id != key->link_id)
+               return;
 
        if (data->unhandled_cipher)
                return;
@@ -1917,6 +1921,10 @@ static void iwl_mvm_d3_update_keys(struct ieee80211_hw *hw,
        struct iwl_mvm_d3_gtk_iter_data *data = _data;
        struct iwl_wowlan_status_data *status = data->status;
        s8 keyidx;
+       int link_id = vif->active_links ? __ffs(vif->active_links) : -1;
+
+       if (link_id >= 0 && key->link_id >= 0 && link_id != key->link_id)
+               return;
 
        if (data->unhandled_cipher)
                return;