]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
hostapd: Make sure ctrl_iface is not initialized multiple times
authorShan Palanisamy <shanp@qca.qualcomm.com>
Thu, 16 Feb 2012 17:44:43 +0000 (19:44 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 16 Feb 2012 17:44:43 +0000 (19:44 +0200)
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

hostapd/ctrl_iface.c
src/ap/hostapd.c

index 0cbb48393430f4379a51a3f1d613c04adb2df599..a2e7cc5dee86883869f8357e8b15e5e236298b32 100644 (file)
@@ -989,7 +989,10 @@ int hostapd_ctrl_iface_init(struct hostapd_data *hapd)
        int s = -1;
        char *fname = NULL;
 
-       hapd->ctrl_sock = -1;
+       if (hapd->ctrl_sock > -1) {
+               wpa_printf(MSG_DEBUG, "ctrl_iface already exists!");
+               return 0;
+       }
 
        if (hapd->conf->ctrl_interface == NULL)
                return 0;
index c5cbdf702326ee64df0075fc6b38b92159ed1ca8..aa57a14e6bec0cb823925afbc35dda78c3a40ea4 100644 (file)
@@ -857,6 +857,7 @@ hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface,
        hapd->conf = bss;
        hapd->iface = hapd_iface;
        hapd->driver = hapd->iconf->driver;
+       hapd->ctrl_sock = -1;
 
        return hapd;
 }