Patchwork P2P: Skip non p2p interface in p2p_group_remove *

login
register
mail settings
Submitter Ilan Peer
Date Aug. 7, 2013, 10:08 a.m.
Message ID <1375870125-27991-6-git-send-email-ilan.peer@intel.com>
Download mbox | patch
Permalink /patch/265474/
State Accepted
Commit d99ca89d987e6bd28dbe37b4c6ff8b6168390627
Headers show

Comments

Ilan Peer - Aug. 7, 2013, 10:08 a.m.
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 |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
Jouni Malinen - Aug. 25, 2013, 8:19 a.m.
On Wed, Aug 07, 2013 at 01:08:42PM +0300, Ilan Peer wrote:
> 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.

Thanks, applied with the logic fixed to support
no-separate-group-interface case (need to check current_ssid->p2p_group
to catch those).

Patch

diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index 2c363ec..06d331b 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -4132,7 +4132,10 @@  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) {
+				wpas_p2p_disconnect(prev);
+			}
 		}
 		return 0;
 	}