summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Cardona <javier@cozybit.com>2008-09-18 12:52:33 -0700
committerDeepak Saxena <dsaxena@laptop.org>2008-09-22 14:03:01 -0700
commitf2c3fe6773a10211fb125a493d061d7365ec8e68 (patch)
tree21c2390dde52264634d57ae2c56af72cad97aac1
parent65748d168a0c553890a2cd65e9856a5725dc86e8 (diff)
downloadlwn-f2c3fe6773a10211fb125a493d061d7365ec8e68.tar.gz
lwn-f2c3fe6773a10211fb125a493d061d7365ec8e68.zip
libertas: Restrict fast key installation to WPA mode.
Commit abe7a66b36f344a822 (in olpc-2.6 repository) addressed the issue of slow WPA key installation, but could break the ordering of iwconfig commands like: iwconfig eth0 essid foobar key 235232363632 mode managed channel 11 This patch adds additional guards to ensure that the fast key installation only applies to WPA. Thanks to Dan Williams for pointing that out. Note to maintainer: This patch and abe7a66b36f344a822 have been submitted as a single patch to wireless-testing: http://marc.info/?l=linux-wireless&m=122161439327313&w=2 Signed-off-by: Javier Cardona <javier@cozybit.com>
-rw-r--r--drivers/net/wireless/libertas/wext.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c
index fc67718a0d92..fd151afa00b5 100644
--- a/drivers/net/wireless/libertas/wext.c
+++ b/drivers/net/wireless/libertas/wext.c
@@ -1622,8 +1622,17 @@ static int lbs_set_encodeext(struct net_device *dev,
}
out:
- if (ret == 0) { /* key installation is time critical: postpone not! */
- lbs_do_association_work(priv);
+ if (ret == 0) {
+ /* 802.1x and WPA rekeying must happen as quickly as possible,
+ * especially during the 4-way handshake; thus if in
+ * infrastructure mode, and either (a) 802.1x is enabled or
+ * (b) WPA is being used, set the key right away.
+ */
+ if (assoc_req->mode == IW_MODE_INFRA &&
+ ((alg == IW_ENCODE_ALG_TKIP) || (alg == IW_ENCODE_ALG_CCMP))) {
+ lbs_do_association_work(priv);
+ } else
+ lbs_postpone_association_work(priv);
} else {
lbs_cancel_association_work(priv);
}