]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Indicate reason=UNAVAILABLE for group netdev going down
authorJouni Malinen <j@w1.fi>
Thu, 8 Jan 2015 20:13:17 +0000 (22:13 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 8 Jan 2015 20:43:48 +0000 (22:43 +0200)
There is a race condition between receiving an AP stopped event and
netdev down event. These resulted in different group removal reasons on
a GO device (UNAVAILABLE for stop AP event coming first and REQUESTED
for netdev event first). Make this more consistent by reporting
UNAVAILABLE for both possible cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
wpa_supplicant/events.c

index 983c2ced5235d466aa689695d13fd2c854454566..3c295c866a8fbf798a40b801e7e55decaf61d49e 100644 (file)
@@ -3400,7 +3400,11 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
                         * it assuming an external entity will start a
                         * new session if needed.
                         */
-                       wpas_p2p_disconnect(wpa_s);
+                       if (wpa_s->current_ssid &&
+                           wpa_s->current_ssid->p2p_group)
+                               wpas_p2p_interface_unavailable(wpa_s);
+                       else
+                               wpas_p2p_disconnect(wpa_s);
                        break;
                }
                if (wpa_s->p2p_scan_work && wpa_s->global->p2p &&