When 6 GHz band is specified and hw_mode parameter is set to any,
hostapd_determine_mode() may determine the wrong mode because there are
two hw modes (5 GHz and 6 GHz) with HOSTAPD_MODE_IEEE80211A. This will
cause 6 GHz AP to fail to start. Fix this by adding a check similar to
the changes in commit
99cd453720d6 ("hw_feature: Correctly select mode
in case of the 6 GHz band") into hostapd_determine_mode().
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
static void hostapd_determine_mode(struct hostapd_iface *iface)
{
- int i;
+ int i, chan;
enum hostapd_hw_mode target_mode;
if (iface->current_mode ||
mode = &iface->hw_features[i];
if (mode->mode == target_mode) {
+ if (iface->freq > 0 &&
+ !hw_mode_get_channel(mode, iface->freq, &chan))
+ continue;
+
iface->current_mode = mode;
iface->conf->hw_mode = mode->mode;
break;