mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-22 06:29:23 +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:
parent
0e72ce8861
commit
15c7379b4d
12
src/rrm.c
12
src/rrm.c
@ -443,6 +443,9 @@ static void rrm_handle_beacon_scan(struct rrm_state *rrm,
|
||||
freq = band_channel_to_freq(beacon->channel, band);
|
||||
scan_freq_set_add(freqs, freq);
|
||||
|
||||
if (!wiphy_constrain_freq_set(wiphy_find_by_wdev(rrm->wdev_id), freqs))
|
||||
goto free_freqs;
|
||||
|
||||
if (passive)
|
||||
beacon->scan_id = scan_passive_full(rrm->wdev_id, ¶ms,
|
||||
rrm_scan_triggered,
|
||||
@ -454,12 +457,13 @@ static void rrm_handle_beacon_scan(struct rrm_state *rrm,
|
||||
rrm_scan_results, rrm,
|
||||
NULL);
|
||||
|
||||
free_freqs:
|
||||
scan_freq_set_free(freqs);
|
||||
|
||||
if (beacon->scan_id == 0) {
|
||||
rrm_info_destroy(&beacon->info);
|
||||
rrm->pending = NULL;
|
||||
}
|
||||
if (beacon->scan_id)
|
||||
return;
|
||||
|
||||
rrm_reject_measurement_request(rrm, REPORT_REJECT_INCAPABLE);
|
||||
}
|
||||
|
||||
static bool rrm_verify_beacon_request(const uint8_t *request, size_t len)
|
||||
|
Loading…
Reference in New Issue
Block a user