]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
OCV: Fix HT/VHT capability check on big-endian CPUs
authorJouni Malinen <j@w1.fi>
Sat, 22 Feb 2025 08:56:27 +0000 (10:56 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 22 Feb 2025 08:59:20 +0000 (10:59 +0200)
These HT/VHT capabilities are little-endian fields and need to be
converted to host byte order before comparison.

Fixes: 1034f67bf152 ("OCV: Add function to derive Tx parameters to a specific STA")
Signed-off-by: Jouni Malinen <j@w1.fi>
src/ap/ieee802_11_shared.c

index 28c2ccb1c74db0521fcad985f87e2333fc229db6..986b7b81e489b08d8bb95de655ddb373ef7011e6 100644 (file)
@@ -1045,7 +1045,8 @@ int get_tx_parameters(struct sta_info *sta, int ap_max_chanwidth,
        int requested_bw;
 
        if (sta->ht_capabilities)
-               ht_40mhz = !!(sta->ht_capabilities->ht_capabilities_info &
+               ht_40mhz = !!(le_to_host16(sta->ht_capabilities->
+                                          ht_capabilities_info) &
                              HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET);
 
        if (sta->vht_operation) {
@@ -1081,9 +1082,9 @@ int get_tx_parameters(struct sta_info *sta, int ap_max_chanwidth,
                 * normal clients), use it to determine the supported channel
                 * bandwidth.
                 */
-               vht_chanwidth = capab->vht_capabilities_info &
+               vht_chanwidth = le_to_host32(capab->vht_capabilities_info) &
                        VHT_CAP_SUPP_CHAN_WIDTH_MASK;
-               vht_80p80 = capab->vht_capabilities_info &
+               vht_80p80 = le_to_host32(capab->vht_capabilities_info) &
                        VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ;
 
                /* TODO: Also take into account Extended NSS BW Support field */