From: Eliad Peller Date: Thu, 19 Mar 2015 14:41:42 +0000 (+0200) Subject: DFS: Fix range availability check X-Git-Tag: hostap_2_5~944 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=030a3e12dad1ff0e987e92ac3b362e851f736031;p=thirdparty%2Fhostap.git 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 Signed-off-by: Eliad Peller --- diff --git a/src/ap/dfs.c b/src/ap/dfs.c index 18030ac58..d458a4275 100644 --- a/src/ap/dfs.c +++ b/src/ap/dfs.c @@ -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];