From 9f52036b8548a5a6874a5c91cddb117b5eb3227c Mon Sep 17 00:00:00 2001 From: Tim Kourt Date: Wed, 27 Feb 2019 16:44:16 -0800 Subject: [PATCH] scan: Let ELL to handle the message sizing --- src/scan.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/scan.c b/src/scan.c index 9787e524..f85103ba 100644 --- a/src/scan.c +++ b/src/scan.c @@ -301,13 +301,6 @@ static void scan_build_attr_scan_frequencies(struct l_genl_msg *msg, l_genl_msg_leave_nested(msg); } -static void scan_freq_count(uint32_t freq, void *user_data) -{ - int *count = user_data; - - *count += 1; -} - static bool scan_mac_address_randomization_is_disabled(void) { const struct l_settings *config = iwd_get_config(); @@ -326,16 +319,9 @@ static struct l_genl_msg *scan_build_cmd(struct scan_context *sc, const struct scan_parameters *params) { struct l_genl_msg *msg; - int n_channels = 0; uint32_t flags = 0; - if (params->freqs) - scan_freq_set_foreach(params->freqs, scan_freq_count, - &n_channels); - - msg = l_genl_msg_new_sized(NL80211_CMD_TRIGGER_SCAN, - 64 + params->extra_ie_size + - 4 * n_channels); + msg = l_genl_msg_new(NL80211_CMD_TRIGGER_SCAN); l_genl_msg_append_attr(msg, NL80211_ATTR_IFINDEX, 4, &sc->ifindex);