DFS: Fix range availability check
There's off-by-one in the range availability check - the case of first_chan_idx + num_chans == num_channels should be allowed (e.g., 0 + 1 == 1, for the case of a single 20 MHz channel). Signed-off-by: Maital Hahn <maitalm@ti.com> Signed-off-by: Eliad Peller <eliad@wizery.com>
This commit is contained in:
parent
56ef99255c
commit
030a3e12da
1 changed files with 1 additions and 1 deletions
|
@ -143,7 +143,7 @@ static int dfs_chan_range_available(struct hostapd_hw_modes *mode,
|
||||||
struct hostapd_channel_data *first_chan, *chan;
|
struct hostapd_channel_data *first_chan, *chan;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (first_chan_idx + num_chans >= mode->num_channels)
|
if (first_chan_idx + num_chans > mode->num_channels)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
first_chan = &mode->channels[first_chan_idx];
|
first_chan = &mode->channels[first_chan_idx];
|
||||||
|
|
Loading…
Reference in a new issue