3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-25 17:59:25 +01:00

rrm: constrain scan frequency before scanning

The RRM module was blindly scanning using the requested
frequency which may or may not be possible given the hardware.
Instead check that the frequency will work and if not reject
the request.

This was reported by a user seeing the RRM scan fail which was
due to the AP requesting a scan on 5GHz when the adapter was
2.4GHz only.
This commit is contained in:
James Prestwood 2022-09-08 15:33:08 -07:00 committed by Denis Kenzior
parent 0e72ce8861
commit 15c7379b4d

View File

@ -443,6 +443,9 @@ static void rrm_handle_beacon_scan(struct rrm_state *rrm,
freq = band_channel_to_freq(beacon->channel, band); freq = band_channel_to_freq(beacon->channel, band);
scan_freq_set_add(freqs, freq); scan_freq_set_add(freqs, freq);
if (!wiphy_constrain_freq_set(wiphy_find_by_wdev(rrm->wdev_id), freqs))
goto free_freqs;
if (passive) if (passive)
beacon->scan_id = scan_passive_full(rrm->wdev_id, &params, beacon->scan_id = scan_passive_full(rrm->wdev_id, &params,
rrm_scan_triggered, rrm_scan_triggered,
@ -454,12 +457,13 @@ static void rrm_handle_beacon_scan(struct rrm_state *rrm,
rrm_scan_results, rrm, rrm_scan_results, rrm,
NULL); NULL);
free_freqs:
scan_freq_set_free(freqs); scan_freq_set_free(freqs);
if (beacon->scan_id == 0) { if (beacon->scan_id)
rrm_info_destroy(&beacon->info); return;
rrm->pending = NULL;
} rrm_reject_measurement_request(rrm, REPORT_REJECT_INCAPABLE);
} }
static bool rrm_verify_beacon_request(const uint8_t *request, size_t len) static bool rrm_verify_beacon_request(const uint8_t *request, size_t len)