|
@@ -567,6 +567,14 @@ static void wpa_supplicant_wps_event_m2d(struct wpa_supplicant *wpa_s,
|
|
|
}
|
|
|
|
|
|
|
|
|
+static void wpas_wps_clear_timeout(void *eloop_ctx, void *timeout_ctx)
|
|
|
+{
|
|
|
+ struct wpa_supplicant *wpa_s = eloop_ctx;
|
|
|
+ wpa_printf(MSG_DEBUG, "WPS: Clear WPS network from timeout");
|
|
|
+ wpas_clear_wps(wpa_s);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
static void wpa_supplicant_wps_event_fail(struct wpa_supplicant *wpa_s,
|
|
|
struct wps_event_fail *fail)
|
|
|
{
|
|
@@ -591,7 +599,14 @@ static void wpa_supplicant_wps_event_fail(struct wpa_supplicant *wpa_s,
|
|
|
"msg=%d config_error=%d",
|
|
|
fail->msg, fail->config_error);
|
|
|
}
|
|
|
- wpas_clear_wps(wpa_s);
|
|
|
+
|
|
|
+ /*
|
|
|
+ * Need to allow WPS processing to complete, e.g., by sending WSC_NACK.
|
|
|
+ */
|
|
|
+ wpa_printf(MSG_DEBUG, "WPS: Register timeout to clear WPS network");
|
|
|
+ eloop_cancel_timeout(wpas_wps_clear_timeout, wpa_s, NULL);
|
|
|
+ eloop_register_timeout(0, 100000, wpas_wps_clear_timeout, wpa_s, NULL);
|
|
|
+
|
|
|
wpas_notify_wps_event_fail(wpa_s, fail);
|
|
|
#ifdef CONFIG_P2P
|
|
|
wpas_p2p_wps_failed(wpa_s, fail);
|
|
@@ -1385,6 +1400,7 @@ int wpas_wps_init(struct wpa_supplicant *wpa_s)
|
|
|
void wpas_wps_deinit(struct wpa_supplicant *wpa_s)
|
|
|
{
|
|
|
eloop_cancel_timeout(wpas_wps_timeout, wpa_s, NULL);
|
|
|
+ eloop_cancel_timeout(wpas_wps_clear_timeout, wpa_s, NULL);
|
|
|
eloop_cancel_timeout(wpas_wps_reenable_networks_cb, wpa_s, NULL);
|
|
|
wpas_wps_clear_ap_info(wpa_s);
|
|
|
|