From patchwork Tue Oct 23 10:19:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: PATCH:P2P We need to set conf variable for group_idle timeout if application has not set it for p2p_client Date: Tue, 23 Oct 2012 00:19:48 -0000 From: Neeraj Garg X-Patchwork-Id: 193420 Message-Id: To: "hostap@lists.shmoo.com" 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 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 --- wpa_supplicant/p2p_supplicant.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) mode change 100644 => 100755 wpa_supplicant/p2p_supplicant.c 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;