From: Shan Palanisamy Date: Thu, 16 Feb 2012 17:44:43 +0000 (+0200) Subject: hostapd: Make sure ctrl_iface is not initialized multiple times X-Git-Tag: hostap_2_0~869 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9e7d033ef4a17b25af5e9798c2edfc9a95a4829a;p=thirdparty%2Fhostap.git hostapd: Make sure ctrl_iface is not initialized multiple times Signed-hostap: Jouni Malinen --- diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c index 0cbb48393..a2e7cc5de 100644 --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c @@ -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; diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index c5cbdf702..aa57a14e6 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -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; }