diff --git a/wpa_supplicant/notify.c b/wpa_supplicant/notify.c index cf8234654..196ae8f5c 100644 --- a/wpa_supplicant/notify.c +++ b/wpa_supplicant/notify.c @@ -252,6 +252,9 @@ void wpas_notify_network_removed(struct wpa_supplicant *wpa_s, wpa_sm_pmksa_cache_flush(wpa_s->wpa, ssid); if (wpa_s->global->p2p_group_formation != wpa_s) wpas_dbus_unregister_network(wpa_s, ssid->id); +#ifdef CONFIG_P2P + wpas_p2p_network_removed(wpa_s, ssid); +#endif /* CONFIG_P2P */ } diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 4ce04321a..c2095ea6a 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -4215,3 +4215,17 @@ int wpas_p2p_in_progress(struct wpa_supplicant *wpa_s) return p2p_in_progress(wpa_s->global->p2p); } + + +void wpas_p2p_network_removed(struct wpa_supplicant *wpa_s, + struct wpa_ssid *ssid) + +{ + if (wpa_s->p2p_in_provisioning && ssid->p2p_group && + eloop_cancel_timeout(wpas_p2p_group_formation_timeout, + wpa_s->parent, NULL) > 0) { + wpa_printf(MSG_DEBUG, "P2P: Canceled group formation due to " + "P2P group network getting removed"); + wpas_p2p_group_formation_timeout(wpa_s->parent, NULL); + } +} diff --git a/wpa_supplicant/p2p_supplicant.h b/wpa_supplicant/p2p_supplicant.h index 6afc4bb06..91400a620 100644 --- a/wpa_supplicant/p2p_supplicant.h +++ b/wpa_supplicant/p2p_supplicant.h @@ -129,5 +129,7 @@ int wpas_p2p_disconnect(struct wpa_supplicant *wpa_s); void wpas_p2p_wps_failed(struct wpa_supplicant *wpa_s, struct wps_event_fail *fail); int wpas_p2p_in_progress(struct wpa_supplicant *wpa_s); +void wpas_p2p_network_removed(struct wpa_supplicant *wpa_s, + struct wpa_ssid *ssid); #endif /* P2P_SUPPLICANT_H */