summaryrefslogtreecommitdiff
path: root/src/ap/acs.c
diff options
context:
space:
mode:
authorRui Paulo <rpaulo@FreeBSD.org>2015-10-14 04:30:17 +0000
committerRui Paulo <rpaulo@FreeBSD.org>2015-10-14 04:30:17 +0000
commitb834757ea3bcd1bba3381ff7cab216458d8f7efb (patch)
treedadb24e00f30aa959ea0981e649b18c668304498 /src/ap/acs.c
parentfbffd80fb2ba16c68f799da68a119d5e69643604 (diff)
Diffstat (limited to 'src/ap/acs.c')
-rw-r--r--src/ap/acs.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/ap/acs.c b/src/ap/acs.c
index ae7f6c3092899..03d797fe8836a 100644
--- a/src/ap/acs.c
+++ b/src/ap/acs.c
@@ -479,16 +479,10 @@ static int acs_usable_chan(struct hostapd_channel_data *chan)
static int is_in_chanlist(struct hostapd_iface *iface,
struct hostapd_channel_data *chan)
{
- int *entry;
-
- if (!iface->conf->chanlist)
+ if (!iface->conf->acs_ch_list.num)
return 1;
- for (entry = iface->conf->chanlist; *entry != -1; entry++) {
- if (*entry == chan->chan)
- return 1;
- }
- return 0;
+ return freq_range_list_includes(&iface->conf->acs_ch_list, chan->chan);
}
@@ -900,6 +894,9 @@ static int acs_request_scan(struct hostapd_iface *iface)
if (chan->flag & HOSTAPD_CHAN_DISABLED)
continue;
+ if (!is_in_chanlist(iface, chan))
+ continue;
+
*freq++ = chan->freq;
}
*freq = 0;