aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wpa_cli.c
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2015-12-10 10:56:06 (GMT)
committerJouni Malinen <j@w1.fi>2015-12-17 22:24:52 (GMT)
commit685ea2f60c2fc09aac83733fcb8a7c8505ebaca4 (patch)
tree269252265660034a90acfcf50fefeb1571698042 /wpa_supplicant/wpa_cli.c
parent0e6a2cf2829384e9864045fca2e4243cf69c6569 (diff)
downloadhostap-685ea2f60c2fc09aac83733fcb8a7c8505ebaca4.zip
hostap-685ea2f60c2fc09aac83733fcb8a7c8505ebaca4.tar.gz
hostap-685ea2f60c2fc09aac83733fcb8a7c8505ebaca4.tar.bz2
wpa_cli: Send ALL_STA command to the correct interface
wpa_ctrl_command_sta(), called by the "ALL_STA" handler, didn't consider ifname_prefix, resulting in various commands being sent to the global control interface, rather than the specified interface when IFNAME= prefix was used. This in turn caused the unexpected "UNKNOWN COMMAND" result be considered as valid station, resulting in infinite loop while trying to get all stations. Fix it by considering ifname_prefix, similarly to _wpa_ctrl_command(). Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Diffstat (limited to 'wpa_supplicant/wpa_cli.c')
-rw-r--r--wpa_supplicant/wpa_cli.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c
index 275bf39..cef18ba 100644
--- a/wpa_supplicant/wpa_cli.c
+++ b/wpa_supplicant/wpa_cli.c
@@ -1927,6 +1927,12 @@ static int wpa_ctrl_command_sta(struct wpa_ctrl *ctrl, char *cmd,
printf("Not connected to hostapd - command dropped.\n");
return -1;
}
+ if (ifname_prefix) {
+ os_snprintf(buf, sizeof(buf), "IFNAME=%s %s",
+ ifname_prefix, cmd);
+ buf[sizeof(buf) - 1] = '\0';
+ cmd = buf;
+ }
len = sizeof(buf) - 1;
ret = wpa_ctrl_request(ctrl, cmd, os_strlen(cmd), buf, &len,
wpa_cli_msg_cb);