]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Restore hapd->interface_added tracking to core hostapd
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 5 Nov 2013 23:38:17 +0000 (01:38 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 5 Nov 2013 23:38:17 +0000 (01:38 +0200)
This reverts parts of commit 390e489c0d9415caf103367136eaa534b559837c
that tried to enable removal of the first BSS. Since that operation is
now forced to remove all BSSs, these changes are not needed. The
hostapd_if_remove() operation in hostapd_free_hapd_data() is problematic
for the first BSS since it ends up freeing driver wrapper information
that is needed later when deinitializing the driver wrapper.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

src/ap/hostapd.c
src/ap/hostapd.h

index 63f7565b38f444be9dc9a5b94b371d2467948e08..14abab902c800cf4fdc2671b656128b64f6be3a0 100644 (file)
@@ -260,7 +260,8 @@ static void hostapd_free_hapd_data(struct hostapd_data *hapd)
 
        authsrv_deinit(hapd);
 
-       if (hostapd_if_remove(hapd, WPA_IF_AP_BSS, hapd->conf->iface)) {
+       if (hapd->interface_added &&
+           hostapd_if_remove(hapd, WPA_IF_AP_BSS, hapd->conf->iface)) {
                wpa_printf(MSG_WARNING, "Failed to remove BSS interface %s",
                           hapd->conf->iface);
        }
@@ -649,6 +650,7 @@ 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,
index adb3728d78d020eebb5b7ed85f3092443765982b..e39a1fdb9c6653917115004bd7bef6900377e3ac 100644 (file)
@@ -101,6 +101,7 @@ struct hostapd_data {
        struct hostapd_iface *iface;
        struct hostapd_config *iconf;
        struct hostapd_bss_config *conf;
+       int interface_added; /* virtual interface added for this BSS */
 
        u8 own_addr[ETH_ALEN];