aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/ieee80211_ioctl.c
diff options
context:
space:
mode:
authorVolker Braun <vbraun@physics.upenn.edu>2007-09-14 11:10:25 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:49:30 -0400
commit139c3a0492745192f999aaa67d11cb63983211f5 (patch)
tree564aa64234227385c118a28f82353ddb8e0a012d /net/mac80211/ieee80211_ioctl.c
parentc39e3a0d0380b12f45bf85a619d3df45e437ee45 (diff)
[MAC80211]: ignore key index on pairwise key (WEP only)
Work-around for broken APs that use a non-zero key index for WEP pairwise keys. With this patch, WEP encryption only is exempt from providing a zero key index. Signed-off-by: Volker Braun <volker.braun@physik.hu-berlin.de> Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Acked-by: Michael Wu <flamingice@sourmilk.net> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mac80211/ieee80211_ioctl.c')
-rw-r--r--net/mac80211/ieee80211_ioctl.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/net/mac80211/ieee80211_ioctl.c b/net/mac80211/ieee80211_ioctl.c
index e1c4502b26bf..51dca21f77c7 100644
--- a/net/mac80211/ieee80211_ioctl.c
+++ b/net/mac80211/ieee80211_ioctl.c
@@ -73,17 +73,23 @@ static int ieee80211_set_encryption(struct net_device *dev, u8 *sta_addr,
73 73
74 sdata = IEEE80211_DEV_TO_SUB_IF(dev); 74 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
75 75
76 if (idx < 0 || idx >= NUM_DEFAULT_KEYS) {
77 printk(KERN_DEBUG "%s: set_encrypt - invalid idx=%d\n",
78 dev->name, idx);
79 return -EINVAL;
80 }
81
76 if (is_broadcast_ether_addr(sta_addr)) { 82 if (is_broadcast_ether_addr(sta_addr)) {
77 sta = NULL; 83 sta = NULL;
78 if (idx >= NUM_DEFAULT_KEYS) {
79 printk(KERN_DEBUG "%s: set_encrypt - invalid idx=%d\n",
80 dev->name, idx);
81 return -EINVAL;
82 }
83 key = sdata->keys[idx]; 84 key = sdata->keys[idx];
84 } else { 85 } else {
85 set_tx_key = 0; 86 set_tx_key = 0;
86 if (idx != 0) { 87 /*
88 * According to the standard, the key index of a pairwise
89 * key must be zero. However, some AP are broken when it
90 * comes to WEP key indices, so we work around this.
91 */
92 if (idx != 0 && alg != ALG_WEP) {
87 printk(KERN_DEBUG "%s: set_encrypt - non-zero idx for " 93 printk(KERN_DEBUG "%s: set_encrypt - non-zero idx for "
88 "individual key\n", dev->name); 94 "individual key\n", dev->name);
89 return -EINVAL; 95 return -EINVAL;