]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Handle 6 GHz channels in Supported Operating Classes with freq_list
authorJouni Malinen <quic_jouni@quicinc.com>
Tue, 5 Mar 2024 15:01:30 +0000 (17:01 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 5 Mar 2024 15:01:30 +0000 (17:01 +0200)
Only the 2.4 and 5 GHz channels were handled previously when removing
operating classes from the Supported Operating Classes element based on
the freq_list parameter. Extend this to include the 6 GHz band as well.

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

index 9eba67160e2fbf7ae52964a24490d0079e4445c7..ff11d20b9903c5137356498e638fc40d891035c8 100644 (file)
@@ -320,6 +320,7 @@ static int wpas_op_class_supported(struct wpa_supplicant *wpa_s,
        int z;
        int freq2 = 0;
        int freq5 = 0;
+       bool freq6 = false;
 
        mode = get_mode(wpa_s->hw.modes, wpa_s->hw.num_modes, op_class->mode,
                        is_6ghz_op_class(op_class->op_class));
@@ -334,7 +335,9 @@ static int wpas_op_class_supported(struct wpa_supplicant *wpa_s,
 
                        if (f == 0)
                                break; /* end of list */
-                       if (f > 4000 && f < 6000)
+                       if (is_6ghz_freq(f))
+                               freq6 = true;
+                       else if (f > 4000 && f < 6000)
                                freq5 = 1;
                        else if (f > 2400 && f < 2500)
                                freq2 = 1;
@@ -343,8 +346,11 @@ static int wpas_op_class_supported(struct wpa_supplicant *wpa_s,
                /* No frequencies specified, can use anything hardware supports.
                 */
                freq2 = freq5 = 1;
+               freq6 = true;
        }
 
+       if (is_6ghz_op_class(op_class->op_class) && !freq6)
+               return 0;
        if (op_class->op_class >= 115 && op_class->op_class <= 130 && !freq5)
                return 0;
        if (op_class->op_class >= 81 && op_class->op_class <= 84 && !freq2)