Error while enabling AP using wpa_supplicant

Jose Blanquicet blanquicet at
Mon Jan 30 08:09:01 PST 2017

Hi Dedy,

On Mon, Jan 30, 2017 at 3:07 PM, Lansky, Dedy wrote:
> Sorry for the late reply. I was on vacation.

Don't worry.

> It seems in your case, device_ap_sme is enabled.
> With that, nl80211_mgmt_subscribe_ap_dev_sme() is called and with previous code there is no beacon registration.
> After the patch, beacon registration is called unconditionally.
> I think we need to restrict the call to nl80211_get_wiphy_data_ap() by changing this line:
>         if (nl80211_get_wiphy_data_ap(bss) == NULL)
> into:
>         if (!drv->device_ap_sme && !drv->use_monitor && nl80211_get_wiphy_data_ap(bss) == NULL)
> Would appreciate if you can test this on your setup.

I tried what you suggested and it worked for me:

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 6080079..5470312 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -3783,7 +3783,8 @@ static int wpa_driver_nl80211_set_ap(void *priv,
        if (beacon_set)
                cmd = NL80211_CMD_SET_BEACON;
-       else if (!nl80211_get_wiphy_data_ap(bss))
+       else if (!drv->device_ap_sme && !drv->use_monitor &&
+                               !nl80211_get_wiphy_data_ap(bss))
                return -ENOBUFS;

        wpa_hexdump(MSG_DEBUG, "nl80211: Beacon head",

What does Jouni think about this solution?


Jose Blanquicet

More information about the Hostap mailing list