From: Jouni Malinen Date: Sun, 1 Mar 2015 09:54:39 +0000 (+0200) Subject: P2P: Direct P2P_CONNECT command to proper interface X-Git-Tag: hostap_2_4~69 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bdf0518bb972a9c82e09801e18c3009d68052764;p=thirdparty%2Fhostap.git P2P: Direct P2P_CONNECT command to proper interface It is possible for the P2P_CONNECT control interface command to be issued on an incorrect interface. While the upper layer component should really use global control interface for this, make this work by redirecting the command to the correct context if needed. Signed-off-by: Jouni Malinen --- diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index a2d79face..e840b352d 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -4741,6 +4741,14 @@ static int p2p_ctrl_connect(struct wpa_supplicant *wpa_s, char *cmd, int pd; int ht40, vht; + if (!wpa_s->global->p2p_init_wpa_s) + return -1; + if (wpa_s->global->p2p_init_wpa_s != wpa_s) { + wpa_dbg(wpa_s, MSG_DEBUG, "Direct P2P_CONNECT command to %s", + wpa_s->global->p2p_init_wpa_s->ifname); + wpa_s = wpa_s->global->p2p_init_wpa_s; + } + /* <"pbc" | "pin" | PIN> [label|display|keypad|p2ps] * [persistent|persistent=] * [join] [auth] [go_intent=<0..15>] [freq=] [provdisc]