Patchwork PATCH:P2P We need to set conf variable for group_idle timeout if application has not set it for p2p_client

login
register
mail settings
Submitter Neeraj Garg
Date Oct. 23, 2012, 10:19 a.m.
Message ID <F764D07D6734DF489C733939E1A6F85A1BD85DFF@SJEXCHMB12.corp.ad.broadcom.com>
Download mbox | patch
Permalink /patch/193420/
State Superseded
Headers show

Comments

Neeraj Garg - Oct. 23, 2012, 10:19 a.m.
Hello,
This patch is to fix the group_removal for p2p_client when the application has not configured the p2p_group_idle timeout to a non-zero value. So wpa_s->conf->p2p_group_idle remains to a default value as 0. But we configure the timeout to P2P_MAX_CLIENT_IDLE if it is p2p_client and application configured value is 0. In the function wpas_p2p_group_idle_timeout(), we check for conf value being 0 and we are not p2p_client. Without the below patch, conf value remains 0 and since current_ssid is removed by wpa_supplicant_mark_disassoc(), we don't have info about current_ssid. Please note that error can be reproduced only if P2P GO is completely removed or no longer in p2p_client range.

The below patch simply sets the conf value to P2P_MAX_CLIENT_IDLE if timeout has been set.


From 36abfff550c2527c2c3c71a4f28a00038913abdd Mon Sep 17 00:00:00 2001
From: Neeraj Garg <neerajkg@broadcom.com>
Date: Tue, 23 Oct 2012 15:33:51 +0530
Subject: [PATCH] PATCH:P2P We need to set conf variable for group_idle timeout if application has not set it for p2p_client

Signed-off-by: Neeraj Garg <neerajkg@broadcom.com>
---
 wpa_supplicant/p2p_supplicant.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
 mode change 100644 => 100755 wpa_supplicant/p2p_supplicant.c

Patch

diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
old mode 100644
new mode 100755
index 9e552c8..6c10f5d
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -4620,8 +4620,10 @@  static void wpas_p2p_set_group_idle_timeout(struct wpa_supplicant *wpa_s)
 
 	timeout = wpa_s->conf->p2p_group_idle;
 	if (wpa_s->current_ssid->mode == WPAS_MODE_INFRA &&
-	    (timeout == 0 || timeout > P2P_MAX_CLIENT_IDLE))
+	    (timeout == 0 || timeout > P2P_MAX_CLIENT_IDLE)) {
 	    timeout = P2P_MAX_CLIENT_IDLE;
+ 	    wpa_s->conf->p2p_group_idle = timeout;
+	}
 
 	if (timeout == 0)
 		return;