]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
ACS: Don't select indoor channel on outdoor operation
authorDavid Bauer <mail@david-bauer.net>
Sun, 11 Sep 2022 16:41:12 +0000 (18:41 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 16 Sep 2022 18:00:21 +0000 (21:00 +0300)
Don't select channels designated for exclusive indoor use when the
country string is set for outdoor operation (country3=0x4f, i.e., the
third character of the country string is 'O').

Signed-off-by: David Bauer <mail@david-bauer.net>
src/ap/acs.c
src/ap/dfs.c

index 7708bc28397495c3ab61b896107834a47058ec01..7ca87960c3ea34c9615e0b4020ec65edb5ef0b9e 100644 (file)
@@ -553,6 +553,10 @@ static void acs_survey_mode_interference_factor(
                if (chan->max_tx_power < iface->conf->min_tx_power)
                        continue;
 
+               if ((chan->flag & HOSTAPD_CHAN_INDOOR_ONLY) &&
+                   iface->conf->country[2] == 0x4f)
+                       continue;
+
                wpa_printf(MSG_DEBUG, "ACS: Survey analysis for channel %d (%d MHz)",
                           chan->chan, chan->freq);
 
@@ -687,6 +691,10 @@ acs_find_ideal_chan_mode(struct hostapd_iface *iface,
                if (chan->max_tx_power < iface->conf->min_tx_power)
                        continue;
 
+               if ((chan->flag & HOSTAPD_CHAN_INDOOR_ONLY) &&
+                   iface->conf->country[2] == 0x4f)
+                       continue;
+
                if (!chan_bw_allowed(chan, bw, 1, 1)) {
                        wpa_printf(MSG_DEBUG,
                                   "ACS: Channel %d: BW %u is not supported",
@@ -1068,6 +1076,10 @@ static int * acs_request_scan_add_freqs(struct hostapd_iface *iface,
                if (chan->max_tx_power < iface->conf->min_tx_power)
                        continue;
 
+               if ((chan->flag & HOSTAPD_CHAN_INDOOR_ONLY) &&
+                   iface->conf->country[2] == 0x4f)
+                       continue;
+
                *freq++ = chan->freq;
        }
 
index 146dd1ada51d1d7b8dc0152db94b7bb31f0770af..7f31f283d39d7dbe412af22b80c89f0f1b06b70c 100644 (file)
@@ -281,6 +281,10 @@ static int dfs_find_channel(struct hostapd_iface *iface,
                if (chan->max_tx_power < iface->conf->min_tx_power)
                        continue;
 
+               if ((chan->flag & HOSTAPD_CHAN_INDOOR_ONLY) &&
+                   iface->conf->country[2] == 0x4f)
+                       continue;
+
                if (ret_chan && idx == channel_idx) {
                        wpa_printf(MSG_DEBUG, "Selected channel %d (%d)",
                                   chan->freq, chan->chan);