hostapd: fix AP mode initialization for nl80211
authorFelix Fietkau <nbd@openwrt.org>
Wed, 11 Nov 2009 14:47:01 +0000 (16:47 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 11 Nov 2009 14:47:01 +0000 (16:47 +0200)
Always bring down the wlan interface, even when not changing the
BSSID, the interface also needs to be down for changing its type
from managed to AP mode.

src/drivers/driver_nl80211.c

index d11141d..97348ef 100644 (file)
@@ -4418,10 +4418,10 @@ static void *i802_init(struct hostapd_data *hapd,
        /* start listening for EAPOL on the default AP interface */
        add_ifidx(drv, drv->ifindex);
 
-       if (params->bssid) {
-               if (hostapd_set_iface_flags(drv, drv->ifname, 0))
-                       goto failed;
+       if (hostapd_set_iface_flags(drv, drv->ifname, 0))
+               goto failed;
 
+       if (params->bssid) {
                if (set_ifhwaddr(drv, drv->ifname, params->bssid))
                        goto failed;
        }