Use wpa_radio data for wpas_wpa_is_in_progress()

This replaces the now unnecessary iteration of get_radio_name() calls.

Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2013-11-24 20:03:40 +02:00
parent 5b81927d58
commit 1b544ffa74

View file

@ -4100,32 +4100,13 @@ static int wpas_conn_in_progress(struct wpa_supplicant *wpa_s)
*/ */
int wpas_wpa_is_in_progress(struct wpa_supplicant *wpa_s, int include_current) int wpas_wpa_is_in_progress(struct wpa_supplicant *wpa_s, int include_current)
{ {
const char *rn, *rn2;
struct wpa_supplicant *ifs; struct wpa_supplicant *ifs;
if (!wpa_s->driver->get_radio_name) { dl_list_for_each(ifs, &wpa_s->radio->ifaces, struct wpa_supplicant,
if (include_current && wpas_conn_in_progress(wpa_s)) { radio_list) {
wpa_dbg(wpa_s, MSG_DEBUG, "Connection is in progress on interface %s - defer",
wpa_s->ifname);
return 1;
}
return 0;
}
rn = wpa_s->driver->get_radio_name(wpa_s->drv_priv);
if (rn == NULL || rn[0] == '\0')
return 0;
for (ifs = wpa_s->global->ifaces; ifs; ifs = ifs->next) {
if (!include_current && ifs == wpa_s) if (!include_current && ifs == wpa_s)
continue; continue;
if (!ifs->driver->get_radio_name)
continue;
rn2 = ifs->driver->get_radio_name(ifs->drv_priv);
if (!rn2 || os_strcmp(rn, rn2) != 0)
continue;
if (wpas_conn_in_progress(ifs)) { if (wpas_conn_in_progress(ifs)) {
wpa_dbg(wpa_s, MSG_DEBUG, "Connection is in progress " wpa_dbg(wpa_s, MSG_DEBUG, "Connection is in progress "
"on interface %s - defer", ifs->ifname); "on interface %s - defer", ifs->ifname);