]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Fix HE 6 GHz capability fetching on big-endian CPUs
authorJouni Malinen <j@w1.fi>
Sat, 22 Feb 2025 09:22:36 +0000 (11:22 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 22 Feb 2025 09:22:36 +0000 (11:22 +0200)
nla_get_u16() returns the value in host byte order and there should be
no extra conversion from little-endian to host byte order.

Fixes: 9272ebae83e6 ("nl80211: Fetch HE 6 GHz capability from the driver")
Signed-off-by: Jouni Malinen <j@w1.fi>
src/drivers/driver_nl80211_capa.c

index 62b16696160c36fcbc38c8b6c48c40231f7a3915..3442e7231d04f0db2c073c74b29baafe6157fe20 100644 (file)
@@ -1993,12 +1993,9 @@ static void phy_info_iftype_copy(struct hostapd_hw_modes *mode,
                          len);
        }
 
-       if (tb[NL80211_BAND_IFTYPE_ATTR_HE_6GHZ_CAPA]) {
-               u16 capa;
-
-               capa = nla_get_u16(tb[NL80211_BAND_IFTYPE_ATTR_HE_6GHZ_CAPA]);
-               he_capab->he_6ghz_capa = le_to_host16(capa);
-       }
+       if (tb[NL80211_BAND_IFTYPE_ATTR_HE_6GHZ_CAPA])
+               he_capab->he_6ghz_capa =
+                       nla_get_u16(tb[NL80211_BAND_IFTYPE_ATTR_HE_6GHZ_CAPA]);
 
        if (!tb[NL80211_BAND_IFTYPE_ATTR_EHT_CAP_MAC] ||
            !tb[NL80211_BAND_IFTYPE_ATTR_EHT_CAP_PHY])