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.
}
+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 */
{
#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;