From 0c802384a77696061f4a06f6a143449c6a3e5b53 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 23 Sep 2012 20:28:03 +0300 Subject: [PATCH] P2P: Fix p2p_group_idle in no-group-interface P2P client case Commit 30ee769235f3170d9bf6b62c11c6e018e97deb84 started skipping P2P group removal if wpa_s->current_ssid is not set and commit 0d30cc240fa36905b034dc9676f9d8da0ac18e56 started clearing wpa_s->current_ssid on disconnection. This combination broke p2p_group_idle timeout on P2P client interface in a case where no separate P2P group interface is used and when the disconnection is triggered by something else than an explicit indication of GO terminating the group. Fix this by relaxing network block matching rules when figuring out whether any of the configured network blocks could be in P2P use. The p2p_group flag alone should be enough for this since temporary P2P group network blocks are removed once the P2P group is terminated. Signed-hostap: Jouni Malinen --- wpa_supplicant/p2p_supplicant.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 1c0ef54fe..b581f3265 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -255,13 +255,12 @@ static int wpas_p2p_group_delete(struct wpa_supplicant *wpa_s, if (ssid == NULL) { /* * The current SSID was not known, but there may still be a - * pending P2P group interface waiting for provisioning. + * pending P2P group interface waiting for provisioning or a + * P2P group that is trying to reconnect. */ ssid = wpa_s->conf->ssid; while (ssid) { - if (ssid->p2p_group && - (ssid->mode == WPAS_MODE_P2P_GROUP_FORMATION || - (ssid->key_mgmt & WPA_KEY_MGMT_WPS))) + if (ssid->p2p_group) break; ssid = ssid->next; }