]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Handle INTERFACE_DISABLED event on a P2P GO interface
authorIlan Peer <ilan.peer@intel.com>
Mon, 2 Sep 2013 12:40:59 +0000 (15:40 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 24 Nov 2013 10:29:20 +0000 (12:29 +0200)
An INTERFACE_DISABLED event received on an interface that is
currently operating a P2P GO means that the group session ended.
In such a case, if the interface was dynamically added remove it, and
if not, remove all the network blocks that are temporary, assuming
that if needed a new session will be started by an external entity.

The use case was triggering rfkill (both SW and HW). This case popped up
as part of a testing cycle, where after a toggle in the rfkill state,
the result was that the interface was not deleted, but on the other hand
the wpa_supplicant did not configure the kernel to re-start the AP
functionality again.

Signed-hostap: Ilan Peer <ilan.peer@intel.com>

wpa_supplicant/events.c

index 2894af5d293b24cb22bffb258d6ba5581fe43d81..7452e3eba47a346726a60319087284003c8ce8ad 100644 (file)
@@ -3196,6 +3196,20 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
                break;
        case EVENT_INTERFACE_DISABLED:
                wpa_dbg(wpa_s, MSG_DEBUG, "Interface was disabled");
+#ifdef CONFIG_P2P
+               if (wpa_s->p2p_group_interface == P2P_GROUP_INTERFACE_GO ||
+                   (wpa_s->current_ssid && wpa_s->current_ssid->p2p_group &&
+                    wpa_s->current_ssid->mode == WPAS_MODE_P2P_GO)) {
+                       /*
+                        * The interface was externally disabled. Remove
+                        * it assuming an external entity will start a
+                        * new session if needed.
+                        */
+                       wpas_p2p_disconnect(wpa_s);
+                       break;
+               }
+#endif /* CONFIG_P2P */
+
                wpa_supplicant_mark_disassoc(wpa_s);
                wpa_supplicant_set_state(wpa_s, WPA_INTERFACE_DISABLED);
                break;