[PATCH 3/3] P2P: p2p connect request return fail for single p2p

Avichal Agarwal avichal.aatsamsung.com
Wed Aug 5 00:00:18 PDT 2015


-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