3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-22 23:09:34 +01:00

knownnetworks: use band_freq_to_channel to verify known freqs

With the addition of 6GHz '6000' is no longer the maximum frequency
that could be in .known_network.freq. For more robustness
band_freq_to_channel is used to validate the frequency.
This commit is contained in:
James Prestwood 2022-03-03 12:09:55 -08:00 committed by Denis Kenzior
parent 778dacd262
commit 1c5a2da046

View File

@ -45,6 +45,7 @@
#include "src/scan.h" #include "src/scan.h"
#include "src/util.h" #include "src/util.h"
#include "src/watchlist.h" #include "src/watchlist.h"
#include "src/band.h"
static struct l_queue *known_networks; static struct l_queue *known_networks;
static size_t num_known_hidden_networks; static size_t num_known_hidden_networks;
@ -856,7 +857,8 @@ static struct l_queue *known_frequencies_from_string(char *freq_set_str)
t = strtoul(freq_set_str, &freq_set_str, 10); t = strtoul(freq_set_str, &freq_set_str, 10);
if (unlikely(errno == ERANGE || !t || t > 6000)) if (unlikely(errno == ERANGE || !t ||
!band_freq_to_channel(t, NULL)))
goto error; goto error;
known_freq = l_new(struct known_frequency, 1); known_freq = l_new(struct known_frequency, 1);