Hi,
On Tue, Nov 20, 2018 at 02:28:46PM -0800, Володимир Остап wrote:
he issue has been discovered during work on other issue
https://lists.01.org/pipermail/connman/2018-November/023085.html
If connman does ACTIVE scan without adding a list of SSIDs
interface_scan_params() in gsupplicant/supplicant.c calls
supplicant_dbus_dict_append_array(&dict, "SSIDs",
DBUS_TYPE_STRING,
append_ssids,
data->scan_params);
which creates an empty entry for "SSIDs" without anything inside.
This dbus msg goes to wpa supplicant to dbus/dbus_new_handles.c to
wpas_dbus_handler_scan() which calls wpas_dbus_get_scan_ssids() because
there is an entry "SSIDs".
Unfortunately wpas_dbus_get_scan_ssids() fails with an error.
Here are my logs:
Nov 17 03:09:10 LogiCircle daemon.debug wpa_supplicant[344]:
wpas_dbus_get_scan_ssids[dbus]: ssids must be an array of arrays of bytes
Nov 17 03:09:10 LogiCircle daemon.debug wpa_supplicant[344]:
wpas_dbus_get_scan_ssids[dbus]: ssids must be an array of arrays of bytes
Nov 17 03:09:10 LogiCircle daemon.debug wpa_supplicant[344]:
wpas_dbus_get_scan_ssids[dbus]: ssids must be an array of arrays of bytes
Nov 17 03:17:06 LogiCircle daemon.debug wpa_supplicant[344]:
wpas_dbus_get_scan_ssids[dbus]: ssids must be an array of arrays of bytes
Nov 17 03:17:06 LogiCircle daemon.debug wpa_supplicant[344]:
wpas_dbus_get_scan_ssids[dbus]: ssids must be an array of arrays of bytes
Nov 17 03:17:06 LogiCircle daemon.debug wpa_supplicant[344]:
wpas_dbus_get_scan_ssids[dbus]: ssids must be an array of arrays of bytes
The patch below is very simple. If there is no SSID in scan_parameters do
not create "SSIDs". The adjacent function supplicant_add_scan_frequency()
does such verification and does not create any empty "Channels".
Also add which wpa_supplicant version you used to test in the commit
message (see below what I mean with the commit message).
==============================
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index 0cb621b9..92941c63 100644
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -4241,11 +4241,13 @@ static void interface_scan_params(DBusMessageIter
*iter, void *user_data)
supplicant_dbus_dict_append_basic(&dict, "Type",
DBUS_TYPE_STRING, &type);
- supplicant_dbus_dict_append_array(&dict, "SSIDs",
- DBUS_TYPE_STRING,
- append_ssids,
- data->scan_params);
+ if (data->scan_params->ssids) {
+ supplicant_dbus_dict_append_array(&dict, "SSIDs",
+ DBUS_TYPE_STRING,
+ append_ssids,
+ data->scan_params);
+ }
Okay, this looks good (obviously, except the whitespace damage)
supplicant_add_scan_frequency(&dict, add_scan_frequencies,
data->scan_params);
} else
PS. I sent this patch from other unregistered email. I hope there is not
going to be any duplicate.
No, all fine with this. In just you are sending HTML emails and your
patch can't be processed by me without starting editing myself
(reformating, writing a commit messages etc). Since I am already
pretty slow responding and handling emails from everyone I would like
to ask from you to make my life simpler by following the usual patch
submission processes.
Thanks,
Daniel