]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Fix the size of the maximum MAC ACL size
authorYu Wang <yyuwang@codeaurora.org>
Tue, 19 Jan 2021 08:28:28 +0000 (16:28 +0800)
committerJouni Malinen <j@w1.fi>
Tue, 30 Mar 2021 21:30:05 +0000 (00:30 +0300)
NL80211_ATTR_MAC_ACL_MAX is a u32 attribute to advertise the maximum
number of MAC addresses that a device can support for MAC ACL. This was
incorrectly used as a u8 attribute which would not work with any values
larger than 255 or on big endian CPUs. Fix this by moving from
nla_get_u8() to nla_get_u32().

Fixes: 3c4ca36330c0 ("hostapd: Support MAC address based access control list")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
src/drivers/driver_nl80211_capa.c

index d3d43d48a7cb562f03fbaf8ed41d315e7a1d0115..cd596e311e59a0e2859bac32a4452c4bd00c03d0 100644 (file)
@@ -891,7 +891,7 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
 
        if (tb[NL80211_ATTR_MAC_ACL_MAX])
                capa->max_acl_mac_addrs =
-                       nla_get_u8(tb[NL80211_ATTR_MAC_ACL_MAX]);
+                       nla_get_u32(tb[NL80211_ATTR_MAC_ACL_MAX]);
 
        wiphy_info_supported_iftypes(info, tb[NL80211_ATTR_SUPPORTED_IFTYPES]);
        wiphy_info_iface_comb(info, tb[NL80211_ATTR_INTERFACE_COMBINATIONS]);