3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-21 03:32:42 +01:00

wiphy: Don't parse attributes of scan reply

The success or not of a scan command is found from the message directly.
There's no need to look for any attribute from the scan netlink answer.
The message is an error message or not, and that tells if the scan has
been started or not.
This commit is contained in:
Tomasz Bursztyka 2015-03-11 15:31:51 +02:00 committed by Denis Kenzior
parent 9c1780c0a1
commit 279ed50441

View File

@ -478,20 +478,16 @@ static struct l_dbus_message *device_get_properties(struct l_dbus *dbus,
static void device_scan_callback(struct l_genl_msg *msg, void *user_data)
{
struct netdev *netdev = user_data;
struct l_genl_attr attr;
uint16_t type, len;
const void *data;
struct l_dbus_message *reply;
if (!l_genl_attr_init(&attr, msg)) {
l_debug("Scan callback");
if (l_genl_msg_get_error(msg) < 0) {
dbus_pending_reply(&netdev->scan_pending,
dbus_error_failed(netdev->scan_pending));
return;
}
while (l_genl_attr_next(&attr, &type, &len, &data)) {
}
l_debug("Scan triggered for netdev %s", netdev->name);
reply = l_dbus_message_new_method_return(netdev->scan_pending);
@ -505,6 +501,8 @@ static struct l_dbus_message *device_scan(struct l_dbus *dbus,
{
struct netdev *netdev = user_data;
l_debug("Scan called from DBus");
if (netdev->scan_pending)
return dbus_error_busy(message);