Search Linux Wireless

Re: mac80211 does not support WPA when used with wext

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Saturday 31 March 2007 13:48, Dan Williams wrote:
> On Sat, 2007-03-31 at 12:00 +0200, Johannes Berg wrote:
> > On Sat, 2007-03-31 at 11:36 +0200, dragoran wrote:
> > > Hello
> > > While testing the iwlwifi driver I noticed that the mac80211 does
> > > provide a wext interface but does not support wpa with it.
> >
> > You must have done something wrong, it works well.
>
> Nope!  This time it's really mac80211 :)
>
> Take a look at ieee80211_sta_scan_result() in mac80211/ieee80211_sta.c.
> Note that it returns custom events for the WPA & RSN IEs.  That's just
> wrong.  We should be using already-defined events.
>
What does that have to do with WPA not working? wpa_supplicant works fine with 
the custom events on my system. Also works fine with the standard events 
which the following patch makes mac80211 use.

--

mac80211: use IWEVGENIE

From: Michael Wu <flamingice@xxxxxxxxxxxx>

Use IWEVGENIE which was defined in WE-18.

Signed-off-by: Michael Wu <flamingice@xxxxxxxxxxxx>
---

 net/mac80211/ieee80211_sta.c |   40 ++++++++++------------------------------
 1 files changed, 10 insertions(+), 30 deletions(-)

diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c
index 087f176..a227c38 100644
--- a/net/mac80211/ieee80211_sta.c
+++ b/net/mac80211/ieee80211_sta.c
@@ -2839,39 +2839,19 @@ ieee80211_sta_scan_result(struct net_device *dev,
 	current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, "");
 
 	if (bss && bss->wpa_ie) {
-		char *buf, *p;
-		int i;
-		buf = kmalloc(30 + bss->wpa_ie_len * 2, GFP_ATOMIC);
-		if (buf) {
-			p = buf;
-			p += sprintf(p, "wpa_ie=");
-			for (i = 0; i < bss->wpa_ie_len; i++)
-				p+= sprintf(p, "%02x", bss->wpa_ie[i]);
-			memset(&iwe, 0, sizeof(iwe));
-			iwe.cmd = IWEVCUSTOM;
-			iwe.u.data.length = strlen(buf);
-			current_ev = iwe_stream_add_point(current_ev, end_buf,
-							  &iwe, buf);
-			kfree(buf);
-		}
+		memset(&iwe, 0, sizeof(iwe));
+		iwe.cmd = IWEVGENIE;
+		iwe.u.data.length = bss->wpa_ie_len;
+		current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe,
+						  bss->wpa_ie);
 	}
 
 	if (bss && bss->rsn_ie) {
-		char *buf, *p;
-		int i;
-		buf = kmalloc(30 + bss->rsn_ie_len * 2, GFP_ATOMIC);
-		if (buf) {
-			p = buf;
-			p += sprintf(p, "rsn_ie=");
-			for (i = 0; i < bss->rsn_ie_len; i++)
-				p+= sprintf(p, "%02x", bss->rsn_ie[i]);
-			memset(&iwe, 0, sizeof(iwe));
-			iwe.cmd = IWEVCUSTOM;
-			iwe.u.data.length = strlen(buf);
-			current_ev = iwe_stream_add_point(current_ev, end_buf,
-							  &iwe, buf);
-			kfree(buf);
-		}
+		memset(&iwe, 0, sizeof(iwe));
+		iwe.cmd = IWEVGENIE;
+		iwe.u.data.length = bss->rsn_ie_len;
+		current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe,
+						  bss->rsn_ie);
 	}
 
 	if (bss) {

Attachment: pgprKA2obpLvj.pgp
Description: PGP signature


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux