]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wpa_supplicant: Fix VHT SGI disabling on big-endian CPUs
authorJouni Malinen <j@w1.fi>
Sat, 22 Feb 2025 09:12:09 +0000 (11:12 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 22 Feb 2025 09:12:09 +0000 (11:12 +0200)
vht_capabilities_info is little-endian and the host byte order values
need to be converted to little-endian when ANDing values.

Fixes: fd83a80815b3 ("wpa_supplicant: Allow disabling VHT SGI capability")
Signed-off-by: Jouni Malinen <j@w1.fi>
wpa_supplicant/wpa_supplicant.c

index 661a7524cd18fd728be6085b3a588034f3f0d20d..af19f228dac0e7df2682fbda39cf560dc7d213cc 100644 (file)
@@ -6658,13 +6658,15 @@ void wpa_supplicant_apply_vht_overrides(
 
 #ifdef CONFIG_HT_OVERRIDES
        if (ssid->disable_sgi) {
-               vhtcaps_mask->vht_capabilities_info |= (VHT_CAP_SHORT_GI_80 |
-                                                       VHT_CAP_SHORT_GI_160);
-               vhtcaps->vht_capabilities_info &= ~(VHT_CAP_SHORT_GI_80 |
-                                                   VHT_CAP_SHORT_GI_160);
+               vhtcaps_mask->vht_capabilities_info |=
+                       host_to_le32(VHT_CAP_SHORT_GI_80 |
+                                    VHT_CAP_SHORT_GI_160);
+               vhtcaps->vht_capabilities_info &=
+                       host_to_le32(~(VHT_CAP_SHORT_GI_80 |
+                                      VHT_CAP_SHORT_GI_160));
                wpa_msg(wpa_s, MSG_DEBUG,
                        "disable-sgi override specified, vht-caps: 0x%x",
-                       vhtcaps->vht_capabilities_info);
+                       le_to_host32(vhtcaps->vht_capabilities_info));
        }
 
        /* if max ampdu is <= 3, we have to make the HT cap the same */