]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/net/wireless/rt2x00/rt2500usb.c
rt2500usb: disallow to set WEP key with non zero index
[net-next-2.6.git] / drivers / net / wireless / rt2x00 / rt2500usb.c
index 08240f813ef48f0bc840835de48f1e95ff736d7f..cdaf93f48263c012649b30d6b72604ac0b853f64 100644 (file)
@@ -350,6 +350,14 @@ static int rt2500usb_config_key(struct rt2x00_dev *rt2x00dev,
        enum cipher curr_cipher;
 
        if (crypto->cmd == SET_KEY) {
+               /*
+                * Disallow to set WEP key other than with index 0,
+                * it is known that not work at least on some hardware.
+                * SW crypto will be used in that case.
+                */
+               if (key->alg == ALG_WEP && key->keyidx != 0)
+                       return -EOPNOTSUPP;
+
                /*
                 * Pairwise key will always be entry 0, but this
                 * could collide with a shared key on the same