]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
iw: fix attribute size mismatch
authorKoen Vandeputte <koen.vandeputte@citymesh.com>
Fri, 7 Jul 2023 14:48:26 +0000 (16:48 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 24 Aug 2023 07:16:56 +0000 (09:16 +0200)
NL80211_ATTR_MAX_AP_ASSOC_STA gets packed as u32 in the kernel.
Change the receiving side to match this, or it will be wrong
on big-endian.

Signed-off-by: Koen Vandeputte <koen.vandeputte@citymesh.com>
Link: https://lore.kernel.org/r/20230707144826.3043151-1-koen.vandeputte@citymesh.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
info.c

diff --git a/info.c b/info.c
index 364f9b3ce265e50bcb2fbeaf7bdbd32a1482d0c5..4c5f4637e1d6af316081fb10c6e3b7e1921e849d 100644 (file)
--- a/info.c
+++ b/info.c
@@ -879,7 +879,7 @@ broken_combination:
 
        if (tb_msg[NL80211_ATTR_MAX_AP_ASSOC_STA])
                printf("\tMaximum associated stations in AP mode: %u\n",
-                      nla_get_u16(tb_msg[NL80211_ATTR_MAX_AP_ASSOC_STA]));
+                      nla_get_u32(tb_msg[NL80211_ATTR_MAX_AP_ASSOC_STA]));
 
        return NL_SKIP;
 }