Hostapd: Beacon set failed

By Protonet Team. Published 12. December 2011.

Right now you’re probably thinking ”Mhhhmm, Bacon” (but no this is about “beacons”).

For our current revision of high-end nodes, we use a motherboard named Asus E35M1-I Deluxe.

This board includes an Atheros AR9280 WLAN chipset which is usually well supported by the default linux compat wireless drivers.

Our software setup (Ubuntu 10.04 LTS3) contains the latest stable version of the HostAP Daemon (v0.7.3) which is compiled with the following build options:

CONFIG_DRIVER_NL80211=y
CONFIG_IEEE80211N=y

Our hostapd config looks a little bit like this:

ctrl_interface=/var/run/hostapd
driver=nl80211
hw_mode=g
wme_enabled=1
ieee80211n=1
ht_capab=[HT40-][SHORT-GI-40][DSSS_CCK-40]
channel=6
ssid=protonet-private
interface=wlan0
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_psk=abcdefghijklmnopqrstuvwxyz
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

And here comes the main reason why I’m writing this blog post:
Whenever we try to start hostapd in verbose mode it shows the following error:

nl80211: Set beacon (beacon_set=0)
nl80211: Beacon set failed: -22 (Invalid argument)
Failed to set beacon head/tail or DTIM period

It seemed like we were the only ones having that issue. Google Search didn’t offer any help. Writing to the linux wireless mailing list didn’t help much either.

So we went with the trial and error approach and therefore compiled hostapd over and over again based on different build configurations.

After 10 days of debugging (seriously!) we finally managed to find a fix.
It turns out that including this build option magically heals hostapd:

CONFIG_IEEE80211R=y

Don’t ask us why enabling Fast BSS Transition (802.11r) solves it. We’ve no idea. If you’re a hostapd developer reading this please enlighten us.