[PATCH] P2P: Remove P2P GO interface on INTERFACE_DISABLED

Ilan Peer ilan.peer at intel.com
Wed Aug 7 06:08:41 EDT 2013


Disconnect a P2P GO interface when the interface is being disabled.

Signed-hostap: Ilan Peer <ilan.peer at intel.com>
---
 wpa_supplicant/events.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index bcfac21..1e804e3 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -2566,6 +2566,9 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
 {
 	struct wpa_supplicant *wpa_s = ctx;
 
+	if (!wpa_s)
+		return;
+
 	if (wpa_s->wpa_state == WPA_INTERFACE_DISABLED &&
 	    event != EVENT_INTERFACE_ENABLED &&
 	    event != EVENT_INTERFACE_STATUS &&
@@ -3030,6 +3033,13 @@ 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) {
+			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;
-- 
1.7.10.4



More information about the HostAP mailing list