diff --git a/src/ap/dpp_hostapd.c b/src/ap/dpp_hostapd.c index 93ffd8cf7..013022a87 100644 --- a/src/ap/dpp_hostapd.c +++ b/src/ap/dpp_hostapd.c @@ -2387,6 +2387,7 @@ hostapd_dpp_chirp_scan_res_handler(struct hostapd_iface *iface) unsigned int i; struct hostapd_hw_modes *mode; int c; + bool chan6 = hapd->iface->hw_features == NULL; if (!bi) return; @@ -2406,7 +2407,21 @@ hostapd_dpp_chirp_scan_res_handler(struct hostapd_iface *iface) } /* Preferred chirping channels */ - int_array_add_unique(&hapd->dpp_chirp_freqs, 2437); + mode = dpp_get_mode(hapd, HOSTAPD_MODE_IEEE80211G); + if (mode) { + for (c = 0; c < mode->num_channels; c++) { + struct hostapd_channel_data *chan = &mode->channels[c]; + + if (chan->flag & (HOSTAPD_CHAN_DISABLED | + HOSTAPD_CHAN_RADAR) || + chan->freq != 2437) + continue; + chan6 = true; + break; + } + } + if (chan6) + int_array_add_unique(&hapd->dpp_chirp_freqs, 2437); mode = dpp_get_mode(hapd, HOSTAPD_MODE_IEEE80211A); if (mode) {