[pkg-wpa-devel] Bug#600589: hostapd+bridge doesn't work if hostapd is not run as a daemon in squeeze

FEJES Jozsef jozsef.fejes at gmail.com
Mon Oct 18 12:23:56 UTC 2010


Package: hostapd
Version: 0.6.10-2

I'm using a very common setup: I want to bridge eth0 + wlan0 (b43
wireless card). When I run hostapd as a daemon, it works fine. But
when I run it from /etc/network/interfaces with the hostapd stanza, it
doesn't work.

Symptoms: in the syslog I see that there's an association and a few
seconds later a "deauthenticated due to a local deauth request"
message. With an increased log level I see an "EAPOL-key timeout"
message. If I do "ifdown wlan0" then "ifup wlan0" then it starts
working.

Why it matters: I upgraded to a 2.6.35 custom kernel. When the
networking is being set up, I get a not supported error, it can't add
wlan0 to the bridge. I read that it happens because with newer
kernels, the wifi adapter needs to be in master mode already. I can't
do that with a "pre-up iwconfig wlan0 mode master" line because it
says "Set Mode" (8B06) : SET failed on device wlan0 ; Invalid
argument". The only way I know to put the card into master mode is if
I run hostapd. I suspect one might say that custom kernels are not
supported, but running hostapd in non-daemon mode sure is. With a .32
kernel the easy workaround is to run it as a daemon mode, but it
doesn't apply with .35, and it should be fixed sooner or later.

It seems to me that hostapd only works if it is run after the bridge
is set up. My old config worked because networking was set up before
hostapd was run, the bridge was already working when hostapd started.
With the new kernel, I can't do the bridge first because of the not
supported error. So hostapd is run first, it puts the card into master
mode, then the bridge is brought up, and it doesn't work, then I can
restart hostapd with ifdown-ifup, and then it works, because it starts
after the bridge.

If there was a way to put the card into master mode without hostapd,
then I could run hostapd as a daemon with the newer kernel, too,
however the bug would still be there. But I can't setup master mode
with iwconfig, how does hostapd do it anyway?

And why doesn't it work if it is started before the bridge is created?





More information about the Pkg-wpa-devel mailing list