]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DFS: Fix range availability check
authorEliad Peller <eliad@wizery.com>
Thu, 19 Mar 2015 14:41:42 +0000 (16:41 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 20 Mar 2015 13:56:59 +0000 (15:56 +0200)
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>
src/ap/dfs.c

index 18030ac58afb96314f41f4f20e57634092f972d8..d458a427593f48aa3b05e3d11c8adf3a49137b35 100644 (file)
@@ -143,7 +143,7 @@ static int dfs_chan_range_available(struct hostapd_hw_modes *mode,
        struct hostapd_channel_data *first_chan, *chan;
        int i;
 
-       if (first_chan_idx + num_chans >= mode->num_channels)
+       if (first_chan_idx + num_chans > mode->num_channels)
                return 0;
 
        first_chan = &mode->channels[first_chan_idx];