[PATCH] P2P: Fix p2p_ctrl_invite_persistent() command processing

Dmitry Shmidt dimitrysh
Thu Sep 13 10:42:14 PDT 2012


Signed-off-by: Dmitry Shmidt <dimitrysh at google.com>
---
 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,
-- 
1.7.7.3




More information about the Hostap mailing list