summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpizza <pizza>2008-01-30 22:01:42 +0000
committerpizza <pizza>2008-01-30 22:01:42 +0000
commit379c1597bc971653000649d6c05cb0e0fafc16b2 (patch)
tree7d774ed0c0b4c0a78cf114db5828ab5d3cb64602
parent74a9e49c582adff65862658d15ef14e4ab98a7cc (diff)
downloadlinux-wlan-ng-379c1597bc971653000649d6c05cb0e0fafc16b2.tar.gz
linux-wlan-ng-379c1597bc971653000649d6c05cb0e0fafc16b2.tar.bz2
linux-wlan-ng-379c1597bc971653000649d6c05cb0e0fafc16b2.zip
Fix a long-standing bug in the GIWENCODE handler.
Thanks to Richard Kennedy and Tormod Volden
-rw-r--r--CHANGES1
-rw-r--r--src/p80211/p80211wext.c9
2 files changed, 6 insertions, 4 deletions
diff --git a/CHANGES b/CHANGES
index 6a903f1..67bd8ee 100644
--- a/CHANGES
+++ b/CHANGES
@@ -41,6 +41,7 @@
* Intersil Corporation as part of PRISM(R) chipset product development.
*
* --------------------------------------------------------------------
+ - Fix bug in the GIWENCODE handler (Richard Kennedy & Tormod Volden)
- Support 2.6.24 kernels (modified patch from Tormod Volden)
- Support 2.6.23 kernels. (With apologies to Martin Dauskardt for a
misapplied patch)
diff --git a/src/p80211/p80211wext.c b/src/p80211/p80211wext.c
index 6fac5d3..521c0ee 100644
--- a/src/p80211/p80211wext.c
+++ b/src/p80211/p80211wext.c
@@ -572,10 +572,13 @@ static int p80211wext_giwencode(netdevice_t *dev,
DBFENTER;
+ i = (erq->flags & IW_ENCODE_INDEX) - 1;
+ erq->flags = 0;
+
if (wlandev->hostwep & HOSTWEP_PRIVACYINVOKED)
- erq->flags = IW_ENCODE_ENABLED;
+ erq->flags |= IW_ENCODE_ENABLED;
else
- erq->flags = IW_ENCODE_DISABLED;
+ erq->flags |= IW_ENCODE_DISABLED;
if (wlandev->hostwep & HOSTWEP_EXCLUDEUNENCRYPTED)
erq->flags |= IW_ENCODE_RESTRICTED;
@@ -592,8 +595,6 @@ static int p80211wext_giwencode(netdevice_t *dev,
goto exit;
}
- erq->flags |= i + 1;
-
/* copy the key from the driver cache as the keys are read-only MIBs */
erq->length = wlandev->wep_keylens[i];
memcpy(key, wlandev->wep_keys[i], erq->length);