From 54c61e6e08183472ffe2a07a067b3bd667a6473c Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 15 Sep 2012 22:21:46 -0700 Subject: [PATCH] P2P: Fix p2p_ctrl_invite_persistent() to parse peer parameter Commit 4d32c0c44db43d496f45c5094a9b6ae60c35115e added another use for the local pos variable and that broke the mechanism used to determine wheter the peer address was provided. Fix this by using a separate pointer to the peer address. Signed-hostap: Jouni Malinen --- wpa_supplicant/ctrl_iface.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index 848d33ddd..51b6fdb1f 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -3520,7 +3520,7 @@ static int p2p_ctrl_invite_persistent(struct wpa_supplicant *wpa_s, char *cmd) char *pos; int id; struct wpa_ssid *ssid; - u8 peer[ETH_ALEN]; + u8 *_peer = NULL, peer[ETH_ALEN]; int freq = 0; int ht40; @@ -3530,6 +3530,7 @@ static int p2p_ctrl_invite_persistent(struct wpa_supplicant *wpa_s, char *cmd) pos += 6; if (hwaddr_aton(pos, peer)) return -1; + _peer = peer; } ssid = wpa_config_get_network(wpa_s->conf, id); if (ssid == NULL || ssid->disabled != 2) { @@ -3549,8 +3550,7 @@ static int p2p_ctrl_invite_persistent(struct wpa_supplicant *wpa_s, char *cmd) ht40 = os_strstr(cmd, " ht40") != NULL; - return wpas_p2p_invite(wpa_s, pos ? peer : NULL, ssid, NULL, freq, - ht40); + return wpas_p2p_invite(wpa_s, _peer, ssid, NULL, freq, ht40); } -- 2.39.2