ath9k: Incorrect key used when group and pairwise ciphers are different.
[pandora-kernel.git] / drivers / net / wireless / ath9k / main.c
index 2888778..95b3371 100644 (file)
@@ -206,7 +206,8 @@ static int ath_key_config(struct ath_softc *sc,
        if (!ret)
                return -EIO;
 
-       sc->sc_keytype = hk.kv_type;
+       if (mac)
+               sc->sc_keytype = hk.kv_type;
        return 0;
 }
 
@@ -756,7 +757,8 @@ static int ath9k_set_key(struct ieee80211_hw *hw,
                        key->hw_key_idx = key->keyidx;
                        /* push IV and Michael MIC generation to stack */
                        key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
-                       key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC;
+                       if (key->alg == ALG_TKIP)
+                               key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC;
                }
                break;
        case DISABLE_KEY: