]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP2: Fix channel 6 inclusion for chirping with non-2 GHz interfaces
authorKani M <kanisumi@codeaurora.org>
Tue, 13 Apr 2021 04:56:47 +0000 (10:26 +0530)
committerJouni Malinen <j@w1.fi>
Wed, 21 Apr 2021 20:14:04 +0000 (23:14 +0300)
When the driver provides a list of supported modes, chan6 ended getting
added even if the 2.4 GHz mode was not included. This resulted in
incorrect behavior of trying to transmit on a not supported channel in
case of 5 GHz only radios.

Fix this by adding the channel 6 by default only if the driver does not
provide a list of supported modes. Whenever the supported modes are
available, only add this channel if it is explicitly listed as an
enabled channel.

Fixes: 8e5739c3ac31 ("DPP2: Check channel 6 validity before adding it to chirp channel list")
Signed-off-by: Kani M <kanisumi@codeaurora.org>
wpa_supplicant/dpp_supplicant.c

index 2bcf10b4e2591f68f1d55fe3bec02d04c8daf6a9..40ef8aeb510fa5d118a8bca84b34cca3af48b821 100644 (file)
@@ -3546,7 +3546,7 @@ static void wpas_dpp_chirp_scan_res_handler(struct wpa_supplicant *wpa_s,
        struct hostapd_hw_modes *mode;
        int c;
        struct wpa_bss *bss;
-       bool chan6;
+       bool chan6 = wpa_s->hw.modes == NULL;
 
        if (!bi && !wpa_s->dpp_reconfig_ssid)
                return;
@@ -3566,7 +3566,6 @@ static void wpas_dpp_chirp_scan_res_handler(struct wpa_supplicant *wpa_s,
        /* Preferred chirping channels */
        mode = get_mode(wpa_s->hw.modes, wpa_s->hw.num_modes,
                        HOSTAPD_MODE_IEEE80211G, false);
-       chan6 = mode == NULL;
        if (mode) {
                for (c = 0; c < mode->num_channels; c++) {
                        struct hostapd_channel_data *chan = &mode->channels[c];