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

wiphy: Scheduled scan startup message was too short

The length needs to be at least 20 bytes so that the third
attribute fits in.
This commit is contained in:
Jukka Rissanen 2014-11-11 17:02:51 +02:00 committed by Denis Kenzior
parent ad86c91b38
commit fcda15c587

View File

@ -760,7 +760,6 @@ static void setup_scheduled_scan(struct wiphy *wiphy, struct netdev *netdev,
uint32_t scan_interval)
{
struct l_genl_msg *msg;
uint16_t len = 4 + 4 + 4;
if (!wiphy->support_scheduled_scan) {
l_debug("Scheduled scan not supported for %s "
@ -769,11 +768,9 @@ static void setup_scheduled_scan(struct wiphy *wiphy, struct netdev *netdev,
return;
}
len += 4;
scan_interval *= 1000; /* in kernel the interval is in msecs */
msg = l_genl_msg_new_sized(NL80211_CMD_START_SCHED_SCAN, len);
msg = l_genl_msg_new_sized(NL80211_CMD_START_SCHED_SCAN, 32);
l_genl_msg_append_attr(msg, NL80211_ATTR_IFINDEX, 4, &netdev->index);
l_genl_msg_append_attr(msg, NL80211_ATTR_SCHED_SCAN_INTERVAL,
4, &scan_interval);