aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wpa_priv.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2016-12-03 16:17:28 (GMT)
committerJouni Malinen <j@w1.fi>2016-12-03 16:17:28 (GMT)
commitda818ee5e981fcb9048ef1467c9a66e937eabd38 (patch)
tree83469f00037b7dfe8b59477e09d6a74e25c67314 /wpa_supplicant/wpa_priv.c
parent002b504d19a90ddb0dda751ffd80a44a89ea880b (diff)
downloadhostap-da818ee5e981fcb9048ef1467c9a66e937eabd38.zip
hostap-da818ee5e981fcb9048ef1467c9a66e937eabd38.tar.gz
hostap-da818ee5e981fcb9048ef1467c9a66e937eabd38.tar.bz2
privsep: Support multiple scan SSIDs
Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/wpa_priv.c')
-rw-r--r--wpa_supplicant/wpa_priv.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/wpa_supplicant/wpa_priv.c b/wpa_supplicant/wpa_priv.c
index 328972f..61d43a6 100644
--- a/wpa_supplicant/wpa_priv.c
+++ b/wpa_supplicant/wpa_priv.c
@@ -134,18 +134,31 @@ static void wpa_priv_cmd_unregister(struct wpa_priv_interface *iface,
static void wpa_priv_cmd_scan(struct wpa_priv_interface *iface,
- char *buf, size_t len)
+ void *buf, size_t len)
{
struct wpa_driver_scan_params params;
+ struct privsep_cmd_scan *scan;
+ unsigned int i;
if (iface->drv_priv == NULL)
return;
+ if (len < sizeof(*scan)) {
+ wpa_printf(MSG_DEBUG, "Invalid scan request");
+ return;
+ }
+
+ scan = buf;
+
os_memset(&params, 0, sizeof(params));
- if (len) {
- params.ssids[0].ssid = (u8 *) buf;
- params.ssids[0].ssid_len = len;
- params.num_ssids = 1;
+ if (scan->num_ssids > WPAS_MAX_SCAN_SSIDS) {
+ wpa_printf(MSG_DEBUG, "Invalid scan request (num_ssids)");
+ return;
+ }
+ params.num_ssids = scan->num_ssids;
+ for (i = 0; i < scan->num_ssids; i++) {
+ params.ssids[i].ssid = scan->ssids[i];
+ params.ssids[i].ssid_len = scan->ssid_lens[i];
}
if (iface->driver->scan2)