hostapd: Make sure ctrl_iface is not initialized multiple times

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Shan Palanisamy 2012-02-16 19:44:43 +02:00 committed by Jouni Malinen
parent 0dcc4dc4b3
commit 9e7d033ef4
2 changed files with 5 additions and 1 deletions

View 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;

View 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;
}