Our Cisco AP's set key index 3 for the PTK. This patch removes the check for the key index. I also tried to set idx=0 by hand, but this did not work (presumably because the AP then discarded my unicast packets with key index 0 instead of 3). With these two patches I can successfully use our dynamic wep wireless network. Signed-off-by: Volker Braun <volker.braun@xxxxxxxxxxxxxxxxxxx> diff --git a/net/mac80211/ieee80211_ioctl.c b/net/mac80211/ieee80211_ioctl.c index fbdd1d1..66b4f5a 100644 --- a/net/mac80211/ieee80211_ioctl.c +++ b/net/mac80211/ieee80211_ioctl.c @@ -385,13 +385,14 @@ static int ieee80211_set_encryption(struct net_device *dev sdata = IEEE80211_DEV_TO_SUB_IF(dev); + if (idx <0 || idx >= NUM_DEFAULT_KEYS) { + printk(KERN_DEBUG "%s: set_encrypt - invalid idx=%d\n", + dev->name, idx); + return -EINVAL; + } + if (is_broadcast_ether_addr(sta_addr)) { sta = NULL; - if (idx >= NUM_DEFAULT_KEYS) { - printk(KERN_DEBUG "%s: set_encrypt - invalid idx=%d\n", - dev->name, idx); - return -EINVAL; - } key = sdata->keys[idx]; /* TODO: consider adding hwaccel support for these; at least @@ -405,12 +406,6 @@ static int ieee80211_set_encryption(struct net_device *dev, * being, this can be only set at compile time. */ } else { set_tx_key = 0; - if (idx != 0) { - printk(KERN_DEBUG "%s: set_encrypt - non-zero idx for " - "individual key\n", dev->name); - return -EINVAL; - } - sta = sta_info_get(local, sta_addr); if (!sta) { #ifdef CONFIG_MAC80211_VERBOSE_DEBUG - To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html