[PATCH 3/3] P2P: p2p connect request return fail for single p2p-interface if already connected

Avichal Agarwal avichal.a at samsung.com
Wed Aug 5 04:36:24 EDT 2015


From 520de36e0d1918eb5249044e92dc7e0896bd40a8 Mon Sep 17 00:00:00 2001
From: Avichal Agarwal <avichal.a at samsung.com>
Date: Wed, 5 Aug 2015 12:30:18 +0530
Subject: [PATCH 3/3] P2P: p2p connect request return fail for single p2p
-interface if already connected

This patch works only for single  p2p interface (which act as GC and GO) whose state is already completed

Signed-off-by: Avichal Agarwal <avichal.a at samsung.com>
Signed-off-by: Kyeong-Chae Lim <kcya.lim at samsung.com>
---
 wpa_supplicant/p2p_supplicant.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index 04db856..21259d2 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -4986,6 +4986,12 @@ int wpas_p2p_connect(struct wpa_supplicant *wpa_s, const u8 *peer_addr,
 
 	if (wpa_s->global->p2p_disabled || wpa_s->global->p2p == NULL)
 		return -1;
+	#ifdef SINGLE_P2P_INTERFACE	
+	if(wpa_s->wpa_state == WPA_COMPLETED) {
+		wpa_printf(MSG_INFO, "P2P: Already connected \n");
+		return -1;
+	}
+	#endif
 
 	if (persistent_id >= 0) {
 		ssid = wpa_config_get_network(wpa_s->conf, persistent_id);
-- 
1.7.9.5


More information about the HostAP mailing list