]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP: Do not use 6 GHz channels for push button
authorJouni Malinen <quic_jouni@quicinc.com>
Fri, 29 Jul 2022 18:15:37 +0000 (21:15 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 22 Aug 2022 16:09:27 +0000 (19:09 +0300)
For now, do not include 6 GHz channels since finding a Configurator from
a large number of channels would take excessive amount of time.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
wpa_supplicant/dpp_supplicant.c

index 8071eced7d7b5f387be5b6d1579152c51a19a8aa..994d183a90fc0cfff2fff8fa664b2314501fa0b1 100644 (file)
@@ -5313,11 +5313,17 @@ static int wpas_dpp_pb_announce(struct wpa_supplicant *wpa_s, int freq);
 static void wpas_dpp_pb_next(void *eloop_ctx, void *timeout_ctx);
 
 
-static bool wpas_dpp_pb_chan_ok(int flags)
+static bool wpas_dpp_pb_chan_ok(struct hostapd_channel_data *chan)
 {
-       return !(flags & (HOSTAPD_CHAN_DISABLED |
-                         HOSTAPD_CHAN_NO_IR |
-                         HOSTAPD_CHAN_RADAR));
+       /* For now, do not include 6 GHz channels since finding a Configurator
+        * from a large number of channels would take excessive amount of time.
+        */
+       if (is_6ghz_freq(chan->freq))
+               return false;
+
+       return !(chan->flag & (HOSTAPD_CHAN_DISABLED |
+                              HOSTAPD_CHAN_NO_IR |
+                              HOSTAPD_CHAN_RADAR));
 }
 
 
@@ -5331,7 +5337,7 @@ static int wpas_dpp_pb_channels(struct wpa_supplicant *wpa_s)
                for (c = 0; c < mode->num_channels; c++) {
                        struct hostapd_channel_data *chan = &mode->channels[c];
 
-                       if (!wpas_dpp_pb_chan_ok(chan->flag))
+                       if (!wpas_dpp_pb_chan_ok(chan))
                                continue;
                        int_array_add_unique(&wpa_s->dpp_pb_freqs, chan->freq);
                }