aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wps_supplicant.c
diff options
context:
space:
mode:
authorBen Greear <greearb@candelatech.com>2011-02-21 19:47:46 (GMT)
committerJouni Malinen <j@w1.fi>2011-02-21 19:47:46 (GMT)
commit4c9695be8f2f377cd9ae500b74df6d9f41f6d91c (patch)
tree383f3d375062d50fabd364d4024966e1f3ba41fd /wpa_supplicant/wps_supplicant.c
parent6fc34d9fe51ee6a060562aaceb166c8fed0fd8a5 (diff)
downloadhostap-4c9695be8f2f377cd9ae500b74df6d9f41f6d91c.zip
hostap-4c9695be8f2f377cd9ae500b74df6d9f41f6d91c.tar.gz
hostap-4c9695be8f2f377cd9ae500b74df6d9f41f6d91c.tar.bz2
WPS ER: Stop eloop only on the last terminate_cb
This allows all WPS ER instances to be cleaned up properly if more than one interface has an active WPS ER when wpa_supplicant is being killed.
Diffstat (limited to 'wpa_supplicant/wps_supplicant.c')
-rw-r--r--wpa_supplicant/wps_supplicant.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c
index 8100f1c..d39d2cd 100644
--- a/wpa_supplicant/wps_supplicant.c
+++ b/wpa_supplicant/wps_supplicant.c
@@ -1543,10 +1543,13 @@ int wpas_wps_er_config(struct wpa_supplicant *wpa_s, const char *uuid,
}
+static int callbacks_pending = 0;
+
static void wpas_wps_terminate_cb(void *ctx)
{
wpa_printf(MSG_DEBUG, "WPS ER: Terminated");
- eloop_terminate();
+ if (--callbacks_pending <= 0)
+ eloop_terminate();
}
#endif /* CONFIG_WPS_ER */
@@ -1555,6 +1558,7 @@ int wpas_wps_terminate_pending(struct wpa_supplicant *wpa_s)
{
#ifdef CONFIG_WPS_ER
if (wpa_s->wps_er) {
+ callbacks_pending++;
wps_er_deinit(wpa_s->wps_er, wpas_wps_terminate_cb, wpa_s);
wpa_s->wps_er = NULL;
return 1;