OSDN Git Service

iwlwifi: mvm: Don't install CMAC/GMAC key in AP mode
authorAndrei Otcheretianski <andrei.otcheretianski@intel.com>
Fri, 25 Sep 2020 21:30:44 +0000 (00:30 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Thu, 1 Oct 2020 18:58:21 +0000 (21:58 +0300)
Due to a missing break, the management multicast key was installed even
though we don't really support it. Fix that, so mac80211 would know that
it should protect frames in software.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20200926002540.019a64e96d44.I609a995611ac5286e442cd54f764eaf4a7249ac0@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c

index 73280a2..5e141eb 100644 (file)
@@ -3438,15 +3438,16 @@ static int __iwl_mvm_mac_set_key(struct ieee80211_hw *hw,
                         */
                        if (key->cipher == WLAN_CIPHER_SUITE_AES_CMAC ||
                            key->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_128 ||
-                           key->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_256)
+                           key->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_256) {
                                ret = -EOPNOTSUPP;
-                       else
-                               ret = 0;
+                               break;
+                       }
 
                        if (key->cipher != WLAN_CIPHER_SUITE_GCMP &&
                            key->cipher != WLAN_CIPHER_SUITE_GCMP_256 &&
                            !iwl_mvm_has_new_tx_api(mvm)) {
                                key->hw_key_idx = STA_KEY_IDX_INVALID;
+                               ret = 0;
                                break;
                        }
 
@@ -3462,6 +3463,8 @@ static int __iwl_mvm_mac_set_key(struct ieee80211_hw *hw,
 
                                if (i >= ARRAY_SIZE(mvmvif->ap_early_keys))
                                        ret = -ENOSPC;
+                               else
+                                       ret = 0;
 
                                break;
                        }