hostapd: Allow the first BSS in a multi-BSS setup to be removed

This moves the vif added check from core hostapd to the driver wrapper
(only driver_nl80211.c uses this) and reorders operations a bit to allow
the first BSS (vif) to be removed from a multi-BSS setup.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Kyeyoon Park 2013-10-30 16:34:32 -07:00 committed by Jouni Malinen
parent 834ee56f78
commit 390e489c0d
3 changed files with 18 additions and 7 deletions

View file

@ -257,8 +257,7 @@ static void hostapd_free_hapd_data(struct hostapd_data *hapd)
authsrv_deinit(hapd);
if (hapd->interface_added &&
hostapd_if_remove(hapd, WPA_IF_AP_BSS, hapd->conf->iface)) {
if (hostapd_if_remove(hapd, WPA_IF_AP_BSS, hapd->conf->iface)) {
wpa_printf(MSG_WARNING, "Failed to remove BSS interface %s",
hapd->conf->iface);
}
@ -644,7 +643,6 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first)
}
}
hapd->interface_added = 1;
if (hostapd_if_add(hapd->iface->bss[0], WPA_IF_AP_BSS,
hapd->conf->iface, hapd->own_addr, hapd,
&hapd->drv_priv, force_ifname, if_addr,
@ -1128,13 +1126,13 @@ hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface,
void hostapd_interface_deinit(struct hostapd_iface *iface)
{
size_t j;
int j;
if (iface == NULL)
return;
hostapd_cleanup_iface_pre(iface);
for (j = 0; j < iface->num_bss; j++) {
for (j = iface->num_bss - 1; j >= 0; j--) {
struct hostapd_data *hapd = iface->bss[j];
hostapd_free_stas(hapd);
hostapd_flush_old_stations(hapd, WLAN_REASON_DEAUTH_LEAVING);