summaryrefslogtreecommitdiff
path: root/packages/zd1211/zd1211-r52/transmitkey.index.fix.diff
blob: a225d37698839190527837dfc65cfc533c134bae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
--- zd1211-driver-r52/src/zd1205.c.orig	2006-02-10 10:02:56.000000000 +0100
+++ zd1211-driver-r52/src/zd1205.c	2006-02-10 10:02:56.000000000 +0100
@@ -5693,7 +5693,12 @@
                 /* Check if the key is not marked as invalid */
                 if (!(erq->flags & IW_ENCODE_NOKEY)) {  // for command: key xxxxxxxxxx [n]
                         //		ZD1211DEBUG(0, "Set contents of key %d\n", index+1);
-                        pSetting->EncryKeyId = index;
+                        /* We change the transmit key only if we are
+                         * transitioning from a no-encrypt state. This
+                         * behavior is deduced from the iwconfig man page */
+                        if (pSetting->EncryOnOff == 0) {
+                            pSetting->EncryKeyId = index;
+                        }
                         memcpy(&pSetting->keyVector[index][0], key, pSetting->WepKeyLen);
                         zd1205_config_wep_keys(macp);
                 } else { // For command: key on