P2P: Skip non-P2P interface in p2p_group_remove *
authorIlan Peer <ilan.peer@intel.com>
Sun, 25 Aug 2013 08:17:14 +0000 (11:17 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 25 Aug 2013 08:17:14 +0000 (11:17 +0300)
When 'p2p_group_remove *' is called while the station interface
is connected, the flow also disconnects the station interface.
Fix this by skipping non-P2P interfaces in the iteration.

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

wpa_supplicant/p2p_supplicant.c

index 55e6c0f..9429f3d 100644 (file)
@@ -4133,7 +4133,11 @@ int wpas_p2p_group_remove(struct wpa_supplicant *wpa_s, const char *ifname)
                while (wpa_s) {
                        prev = wpa_s;
                        wpa_s = wpa_s->next;
-                       wpas_p2p_disconnect(prev);
+                       if (prev->p2p_group_interface !=
+                           NOT_P2P_GROUP_INTERFACE ||
+                           (prev->current_ssid &&
+                            prev->current_ssid->p2p_group))
+                               wpas_p2p_disconnect(prev);
                }
                return 0;
        }