提交 22d8846e 编写于 作者: D Dan Williams 提交者: John W. Linville

[PATCH] wireless/airo: fix setting TX key index plus key in ENCODEEXT

The previous patch that added ENCODEEXT and AUTH support to the airo
driver contained a slight error which would cause setting the TX
key index ignore a valid key-set request at the same time.  This patch
allows any combination of setting the TX key index and setting an
encryption key.
Signed-off-by: NDan Williams <dcbw@redhat.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 1ba61e05
...@@ -6266,7 +6266,7 @@ static int airo_set_encodeext(struct net_device *dev, ...@@ -6266,7 +6266,7 @@ static int airo_set_encodeext(struct net_device *dev,
CapabilityRid cap_rid; /* Card capability info */ CapabilityRid cap_rid; /* Card capability info */
int perm = ( encoding->flags & IW_ENCODE_TEMP ? 0 : 1 ); int perm = ( encoding->flags & IW_ENCODE_TEMP ? 0 : 1 );
u16 currentAuthType = local->config.authType; u16 currentAuthType = local->config.authType;
int idx, key_len, alg = ext->alg; /* Check encryption mode */ int idx, key_len, alg = ext->alg, set_key = 1;
wep_key_t key; wep_key_t key;
/* Is WEP supported ? */ /* Is WEP supported ? */
...@@ -6289,10 +6289,15 @@ static int airo_set_encodeext(struct net_device *dev, ...@@ -6289,10 +6289,15 @@ static int airo_set_encodeext(struct net_device *dev,
if (encoding->flags & IW_ENCODE_DISABLED) if (encoding->flags & IW_ENCODE_DISABLED)
alg = IW_ENCODE_ALG_NONE; alg = IW_ENCODE_ALG_NONE;
/* Just setting the transmit key? */
if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) { if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) {
/* Only set transmit key index here, actual
* key is set below if needed.
*/
set_wep_key(local, idx, NULL, 0, perm, 1); set_wep_key(local, idx, NULL, 0, perm, 1);
} else { set_key = ext->key_len > 0 ? 1 : 0;
}
if (set_key) {
/* Set the requested key first */ /* Set the requested key first */
memset(key.key, 0, MAX_KEY_SIZE); memset(key.key, 0, MAX_KEY_SIZE);
switch (alg) { switch (alg) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册