Please note: This project is no longer active. The website is kept online for historic purposes only.
If you´re looking for a Linux driver for your Atheros WLAN device, you should continue here .

Ticket #241 (closed defect: fixed)

Opened 13 years ago

Last modified 11 years ago

Hostapd + RSN broken

Reported by: Stijn Tintel <stijn@linux-ipv6.be> Assigned to:
Priority: major Milestone: version 0.9.4
Component: madwifi: 802.11 stack Version: trunk
Keywords: Cc: charles@bovy.nl,jkmaline@cc.hut.fi
Patch is attached: 1 Pending:

Description

The changes commited in r1357 break RSN support with hostapd (both 0.4.7 and 0.5.0 CVS). This problem did not occur with r1356. WPA still works fine with r1357.

I'll attach the output from hostapd -dd running with r1356 and r1357.

Attachments

r1356_hostapd-rsn.log (4.9 kB) - added by Stijn Tintel <stijn@linux-ipv6.be> on 12/19/05 04:29:54.
Hostapd + RSN output with r1356
r1357_hostapd-rsn.log (2.4 kB) - added by Stijn Tintel <stijn@linux-ipv6.be> on 12/19/05 04:30:29.
Hostapd + RSN output with r1357
madwifi-ng-241.diff (1.1 kB) - added by Charles Bovy <charles@bovy.nl> on 12/20/05 11:46:16.
patch for WPA and RSN ie in AP mode
hostapd.patch (0.8 kB) - added by Charles Bovy <charles@bovy.nl> on 12/20/05 15:29:02.
RSN only patch for hostapd
hostapd-rsn+wpa.patch (1.9 kB) - added by parthan@gmail.com on 01/31/06 20:24:00.
hostapd patch that works for RSN or WPA IEs
hostapd-devel.patch (1.3 kB) - added by parthan@gmail.com on 02/12/06 18:26:48.
Patch against CVS version of hostapd. WARNING: I have not tested this myself since my AP is still operating at hostapd-0.4.7.
madwifi-ng-241-new.diff (2.3 kB) - added by charles on 02/18/06 17:51:37.
new version of madwifi-ng-241.diff. Patch corrects some leftovers from Ticket 132. Please keep in mind, hostapd must support dual IEs (WPA and RSN). Signed-off: Charles Bovy <charles@bovy.nl>
hostapd-devel-new.patch (1.3 kB) - added by Stijn Tintel <stijn@linux-ipv6.be> on 02/19/06 11:26:02.
This patch fixes a typo which caused a compile error in the hostapd-devel.patch from parthan. With this patch applied to hostapd-devel, and with madwifi-ng-241-new.diff patch applied to (current) madwifi-ng, both WPA and RSN seem to work again. Signed-off-by
hostapd-devel-committed.diff (1.4 kB) - added by jmaline@cc.hut.fi on 02/21/06 04:16:33.
hostapd change committed to CVS devel branch

Change History

12/19/05 04:29:54 changed by Stijn Tintel <stijn@linux-ipv6.be>

  • attachment r1356_hostapd-rsn.log added.

Hostapd + RSN output with r1356

12/19/05 04:30:29 changed by Stijn Tintel <stijn@linux-ipv6.be>

  • attachment r1357_hostapd-rsn.log added.

Hostapd + RSN output with r1357

12/19/05 05:20:07 changed by Stijn Tintel <stijn@linux-ipv6.be>

  • cc set to Charles Bovy <charles@bovy.nl>.

12/19/05 05:28:15 changed by Stijn Tintel <stijn@linux-ipv6.be>

I added Charles Bovy in CC, as he committed the patch from #132 that was commited in r1357, which is causing this problem.

Using r1360 with the changes from r1357 removed has no problem with hostapd + RSN.

12/19/05 09:39:36 changed by mrenzmann

  • cc changed from Charles Bovy <charles@bovy.nl> to charles@bovy.nl.

12/19/05 09:39:55 changed by mrenzmann

Charles, could you please investigate this problem? It would be interesting to find out if it is caused because hostapd "works around" the problem and that workaround now fails since the problem has been solved. Read: first thing would be to find out whether this has to be solved in MadWifi or in hostapd.

12/20/05 11:12:12 changed by Charles Bovy

Sorry, did not test my patch in AP mode. We need to provide both WPA and RSN ie to hostapd. So, we need to change madwifi-ng (struct ieee80211req_wpaie) and adapt hostapd so hostapd can handle both WPA and RSN ie. Before the RSN ie was stored in the wpa_ie, which resulted in RSN being preferred above WPA. I'll try to write a patch asap and post it.

The following is going to change in ieee80211_ioctl.h:

struct ieee80211req_wpaie {
        u_int8_t        wpa_macaddr[IEEE80211_ADDR_LEN];
        u_int8_t        wpa_ie[IEEE80211_MAX_OPT_IE];
        u_int8_t        rsn_ie[IEEE80211_MAX_OPT_IE];
};

Can someone have a look at hostapd code and change it so it can select wpa_ie or rsn_ie?

12/20/05 11:22:28 changed by Stijn Tintel <stijn@linux-ipv6.be>

  • cc changed from charles@bovy.nl to charles@bovy.nl,jkmaline@cc.hut.fi.

Jouni, could you please take a look at this problem? MadWifi-ng now reports both wpa_ie and rsn_ie in station mode (#132), but this fix seems to break RSN support with hostapd.

12/20/05 11:46:16 changed by Charles Bovy <charles@bovy.nl>

  • attachment madwifi-ng-241.diff added.

patch for WPA and RSN ie in AP mode

12/20/05 15:29:02 changed by Charles Bovy <charles@bovy.nl>

  • attachment hostapd.patch added.

RSN only patch for hostapd

12/20/05 15:39:36 changed by Charles Bovy <charles@bovy.nl>

Stijn, can you test both the patches? The madwifi-ng patch enables WPA and RSN in AP mode. The hostapd patch forces only to use RSN. This patch is not complete, but needs some customisation of the hostapd-team.

12/20/05 16:34:59 changed by Stijn Tintel <stijn@linux-ipv6.be>

Charles, RSN seems to work now, but WPA doesn't anymore. I assume this is because the hostapd patch still needs to be customized, please confirm.

12/20/05 16:42:05 changed by Charles Bovy <charles@bovy.nl>

Right, I did some dirty patching to test whether the patch to madwifi-ng works. So it seems to work. Hostapd has to do some coding to support both WPA and RSN. Now it only supports RSN due to the fact I forced to use RSN in hostapd. I hope Jouni takes care of that.

Can some confirm this is the right way forward of supplying both WPA and RSN IE?

01/31/06 20:24:00 changed by parthan@gmail.com

  • attachment hostapd-rsn+wpa.patch added.

hostapd patch that works for RSN or WPA IEs

01/31/06 20:27:05 changed by parthan@gmail.com

hostapd-rsn+wpa.patch : I tested with this patch and I am able to authenticate using either WPA or WPA2. I guess this belongs under hostapd, but if others can confirm that it works for them too, we can push it to hostapd.

02/01/06 06:49:17 changed by kelmo

  • patch_attached set to 1.

02/04/06 10:48:43 changed by anonymous

I'm using madwifi-ng r1437 and hostapd 0.4.7 with the provided patches. It works flawlessly. Thanks!

02/10/06 05:34:18 changed by Stijn Tintel <stijn@linux-ipv6.be>

Unfortunately, hostapd-rsn+wpa.patch does not apply cleanly to the hostapd development branch. Because of that, I haven't been able to test it yet.

@parthan: is it possible for you to create a patch for the hostapd development branch? I tried to figure it out myself, but I did not succeed.

I also noticed an issue with madwifi-ng-241.diff applied. Although RSN is enabled, the RSN flag doesn't show up when typing 'wlanconfig athX list sta':

ADDR               AID CHAN RATE RSSI  DBM IDLE  TXSEQ  RXSEQ CAPS ACAPS ERP    STATE     MODE
00:0e:35:9f:bd:6e    1    1  54M   51  -44    0     13   1312 EPSs         0       27   Normal WME

When switching back to WPA, the WPA flag is shown as it should be:

ADDR               AID CHAN RATE RSSI  DBM IDLE  TXSEQ  RXSEQ CAPS ACAPS ERP    STATE     MODE
00:0e:35:9f:bd:6e    1    1  54M   52  -43   15     10    496 EPSs         0       27   Normal WPA WME

With SVN revisions before r1357, the RSN flag was also shown as it should be when RSN was enabled.

02/10/06 08:10:04 changed by Stijn Tintel <stijn@linux-ipv6.be>

Output from 'wlanconfig athX list sta' with r1357, RSN enabled:

ADDR               AID CHAN RATE RSSI  DBM IDLE  TXSEQ  RXSEQ CAPS ACAPS ERP    STATE     MODE
00:0e:35:9f:bd:6e    1    1  12M   39  -56    0    422   1488 EPSs         0       27   Normal RSN WME

02/10/06 19:08:11 changed by Charles

Stijn,

What is the result of wlanconfig with my 'dirty' patch on hostapd?

02/10/06 19:32:32 changed by Stijn Tintel <stijn@linux-ipv6.be>

Charles

The first output from wlanconfig in my previous (the one where the RSN flag is missing) is with hostapd.patch from this ticket applied to hostapd. I would not be able to use RSN if I didn't use that one, as the new patch does not apply to the hostapd version I'm using.

02/12/06 18:26:48 changed by parthan@gmail.com

  • attachment hostapd-devel.patch added.

Patch against CVS version of hostapd. WARNING: I have not tested this myself since my AP is still operating at hostapd-0.4.7.

02/18/06 17:51:37 changed by charles

  • attachment madwifi-ng-241-new.diff added.

new version of madwifi-ng-241.diff. Patch corrects some leftovers from Ticket 132. Please keep in mind, hostapd must support dual IEs (WPA and RSN). Signed-off: Charles Bovy <charles@bovy.nl>

02/19/06 11:26:02 changed by Stijn Tintel <stijn@linux-ipv6.be>

  • attachment hostapd-devel-new.patch added.

This patch fixes a typo which caused a compile error in the hostapd-devel.patch from parthan. With this patch applied to hostapd-devel, and with madwifi-ng-241-new.diff patch applied to (current) madwifi-ng, both WPA and RSN seem to work again. Signed-off-by

02/19/06 11:40:36 changed by Stijn Tintel <stijn@linux-ipv6.be>

I seem to have forgotten something in my comment while attaching hostapd-devel-new.patch; here it is:

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>

02/19/06 18:21:31 changed by mrenzmann

  • status changed from new to assigned.
  • owner set to mrenzmann.
  • milestone set to version 0.9.0 - move to new codebase.

madwifi-ng-241-new.diff applied in r1453. Thanks for your work, guys.

Can someone please keep an eye on the hostapd repository and add a comment here once the necessary changes (from hostapd-devel-new.patch) have been committed there?

02/21/06 04:16:33 changed by jmaline@cc.hut.fi

  • attachment hostapd-devel-committed.diff added.

hostapd change committed to CVS devel branch

02/21/06 04:25:01 changed by jkmaline@cc.hut.fi

I committed a change to hostapd devel branch to use the new rsn_ie variable. The committed change (attached hostapd-devel-committed.diff) is a bit different (cleaner from my viewpoint) than the proposed change. Anyway, the end result is identical in practice. I verified that this works with madwifi-ng r1453 in WPA, WPA2, and WPA+WPA2 configurations.

PS.

Please consider adding something to allow user space programs handle kernel-user space ABI changes more properly when modifying ieee80211_ioctl.h. This change breaks hostapd builds against any older revision of madwifi-ng and that is not really something I would like to be doing. If something like "#define IEEE80211REQ_WPAIEE_HAS_RSN_IE" had been added into ieee80211_ioctl.h, I could have used that to make hostapd build against both old and new revisions of madwifi-ng. I do understand that this is still under development, but I really try to avoid compilation failures with driver interfaces and in this case, the only way to do that would have been to make a local copy of the driver header file and I'm too lazy to do that for just one driver ;-).

02/21/06 06:57:46 changed by mrenzmann

@Jouni: thanks for the information.

Re the kernel-user space ABI change suggestion: would it help you if we add something like you've proposed "after the fact" (now)?

02/21/06 07:20:13 changed by jkmaline@cc.hut.fi

It would make it easier for me to accept this change into the 0.4.x stable branch if something to make this conditional were added and since I haven't releases any 0.5.x versions with this, it would not be late even for that.

04/20/06 14:28:34 changed by kelmo

  • milestone changed from version 0.9.0 - move to new codebase to version 0.9.x - progressive release candidate phase.

ping Mike, would be nice to finish this one off ;-)

06/05/06 00:18:35 changed by BrainSlayer

its working but the performance is poor. wpa_supplicant agains a non atheros wpa2 supporting router works with good performance. but with atheros in ap mode, using hostapd i get just 400 - 500 kb/s maximum (unencrypted 3mb/s)

(follow-up: ↓ 25 ) 06/05/06 00:23:55 changed by mentor

What does wlanconfig list caps say?

(in reply to: ↑ 24 ) 05/12/08 21:44:02 changed by kozmomike@gmail.com

This was fixed a year ago, but part of the required code is left in the MADWIFI_NG defines in the hostapd driver, is this correct? It doesn't rely on the ng branch any more does it? I have it working with the nightly madwifi driver and 5.10 with the #ifndefs removed. I could provide a patch, quite an easy one.

05/12/08 22:17:01 changed by mentor

madwifi-ng is now madwifi.

05/14/08 14:38:43 changed by mrenzmann

  • status changed from assigned to new.
  • owner deleted.

05/14/08 15:19:26 changed by mentor

  • status changed from new to closed.
  • resolution set to fixed.
  • milestone changed from version 0.9.x - progressive release candidate phase to version 0.9.4.

I believe this problem is fixed in madwifi, and any further problems are in the hostapd source.

Closing as fixed.