]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Clear P2P state if active interface is disabled
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 15 May 2014 18:32:54 +0000 (21:32 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 15 May 2014 18:32:54 +0000 (21:32 +0300)
The radio works for the interface get removed if interface is disabled.
This could have left P2P module in invalid state if the interface got
disabled during a p2p_find or p2p_listen operation. Clear the state in
such a case to avoid blocking following operations due to P2P module
assuming it is still in progress of doing something.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
wpa_supplicant/events.c

index 086c5109347a39e1dd3bfce2e01c9592209d250b..9bc812d4e2c0c8d96d5b2c8b8e6a127a70efccf9 100644 (file)
@@ -3356,6 +3356,13 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
                        wpas_p2p_disconnect(wpa_s);
                        break;
                }
+               if (wpa_s->p2p_scan_work && wpa_s->global->p2p &&
+                   p2p_in_progress(wpa_s->global->p2p) > 1) {
+                       /* This radio work will be cancelled, so clear P2P
+                        * state as well.
+                        */
+                       p2p_stop_find(wpa_s->global->p2p);
+               }
 #endif /* CONFIG_P2P */
 
                if (wpa_s->wpa_state >= WPA_AUTHENTICATING) {