From patchwork Thu Sep 13 17:42:14 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: P2P: Fix p2p_ctrl_invite_persistent() command processing Date: Thu, 13 Sep 2012 07:42:14 -0000 From: Dmitry Shmidt X-Patchwork-Id: 183691 Message-Id: <20120913174510.6665938383@ushik.mtv.corp.google.com> To: hostap@lists.shmoo.com Signed-off-by: Dmitry Shmidt --- wpa_supplicant/ctrl_iface.c | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-) diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index 848d33d..908e40e 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -3525,12 +3525,6 @@ static int p2p_ctrl_invite_persistent(struct wpa_supplicant *wpa_s, char *cmd) int ht40; id = atoi(cmd); - pos = os_strstr(cmd, " peer="); - if (pos) { - pos += 6; - if (hwaddr_aton(pos, peer)) - return -1; - } ssid = wpa_config_get_network(wpa_s->conf, id); if (ssid == NULL || ssid->disabled != 2) { wpa_printf(MSG_DEBUG, "CTRL_IFACE: Could not find SSID id=%d " @@ -3547,6 +3541,13 @@ static int p2p_ctrl_invite_persistent(struct wpa_supplicant *wpa_s, char *cmd) return -1; } + pos = os_strstr(cmd, " peer="); + if (pos) { + pos += 6; + if (hwaddr_aton(pos, peer)) + return -1; + } + ht40 = os_strstr(cmd, " ht40") != NULL; return wpas_p2p_invite(wpa_s, pos ? peer : NULL, ssid, NULL, freq,