diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-02-17 12:47:14 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-02-21 14:45:26 -0500 |
commit | 5dcbf480473f6c3f06ad2426b7517038a2a18911 (patch) | |
tree | 66d2cbefee018ff46d499e0aeab573aa94558353 /drivers | |
parent | 7be081539e540517d5e1fcbf96b8080074afbf08 (diff) |
iwlwifi: fix key removal
When trying to remove a key, we always send key
flags just setting the key type, not including
the multicast flag and the key ID. As a result,
whenever any key was removed, the unicast key 0
would be removed, causing a complete connection
loss after the second rekey (the first doesn't
cause a key removal). Fix the key removal code
to include the key ID and multicast flag, thus
removing the correct key.
Cc: stable@vger.kernel.org
Reported-by: Alexander Schnaidt <alex.schnaidt@googlemail.com>
Tested-by: Alexander Schnaidt <alex.schnaidt@googlemail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-sta.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c index 7353826095f1..e483cfa8d14e 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c | |||
@@ -1187,6 +1187,7 @@ int iwl_remove_dynamic_key(struct iwl_priv *priv, | |||
1187 | unsigned long flags; | 1187 | unsigned long flags; |
1188 | struct iwl_addsta_cmd sta_cmd; | 1188 | struct iwl_addsta_cmd sta_cmd; |
1189 | u8 sta_id = iwlagn_key_sta_id(priv, ctx->vif, sta); | 1189 | u8 sta_id = iwlagn_key_sta_id(priv, ctx->vif, sta); |
1190 | __le16 key_flags; | ||
1190 | 1191 | ||
1191 | /* if station isn't there, neither is the key */ | 1192 | /* if station isn't there, neither is the key */ |
1192 | if (sta_id == IWL_INVALID_STATION) | 1193 | if (sta_id == IWL_INVALID_STATION) |
@@ -1212,7 +1213,14 @@ int iwl_remove_dynamic_key(struct iwl_priv *priv, | |||
1212 | IWL_ERR(priv, "offset %d not used in uCode key table.\n", | 1213 | IWL_ERR(priv, "offset %d not used in uCode key table.\n", |
1213 | keyconf->hw_key_idx); | 1214 | keyconf->hw_key_idx); |
1214 | 1215 | ||
1215 | sta_cmd.key.key_flags = STA_KEY_FLG_NO_ENC | STA_KEY_FLG_INVALID; | 1216 | key_flags = cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS); |
1217 | key_flags |= STA_KEY_FLG_MAP_KEY_MSK | STA_KEY_FLG_NO_ENC | | ||
1218 | STA_KEY_FLG_INVALID; | ||
1219 | |||
1220 | if (!(keyconf->flags & IEEE80211_KEY_FLAG_PAIRWISE)) | ||
1221 | key_flags |= STA_KEY_MULTICAST_MSK; | ||
1222 | |||
1223 | sta_cmd.key.key_flags = key_flags; | ||
1216 | sta_cmd.key.key_offset = WEP_INVALID_OFFSET; | 1224 | sta_cmd.key.key_offset = WEP_INVALID_OFFSET; |
1217 | sta_cmd.sta.modify_mask = STA_MODIFY_KEY_MASK; | 1225 | sta_cmd.sta.modify_mask = STA_MODIFY_KEY_MASK; |
1218 | sta_cmd.mode = STA_CONTROL_MODIFY_MSK; | 1226 | sta_cmd.mode = STA_CONTROL_MODIFY_MSK; |