scan: Fix logic error in frequency validation

The intent here was to validate that the frequency is a multiple of 5
and lies in a certain range.  Somehow the channel was checked for being
a multiple of 5 instead.
This commit is contained in:
Denis Kenzior 2019-10-17 18:00:33 -05:00
parent 9ec50c910b
commit f878ec275d
1 changed files with 2 additions and 2 deletions

View File

@ -1523,7 +1523,7 @@ uint8_t scan_freq_to_channel(uint32_t freq, enum scan_band *out_band)
}
if (freq >= 5005 && freq < 5900) {
if (channel % 5)
if (freq % 5)
return 0;
channel = (freq - 5000) / 5;
@ -1535,7 +1535,7 @@ uint8_t scan_freq_to_channel(uint32_t freq, enum scan_band *out_band)
}
if (freq >= 4905 && freq < 5000) {
if (channel % 5)
if (freq % 5)
return 0;
channel = (freq - 4000) / 5;