knownnetworks: use band_freq_to_channel to verify known freqs
James Prestwood
PATCH v2 1/1 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.
--- src/knownnetworks.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
src/knownnetworks.c +3 -1
@@ -45,6 +45,7 @@#include "src/scan.h" #include "src/util.h" #include "src/watchlist.h" +#include "src/band.h" static struct l_queue *known_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 ); -if (unlikely (errno ==ERANGE || !t || t >6000 )) +if (unlikely (errno ==ERANGE || !t || + !band_freq_to_channel (t,NULL ))) goto error; known_freq = l_new(struct known_frequency, 1);
Signature · 1 line
2.34.1
Denis Kenzior
AppliedHi James,
Quoted 7 lines · James Prestwood
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_channelis used to validate the frequency.--- src/knownnetworks.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Applied, thanks.
Regards,
-Denis