[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20250405184807.701728-3-olek2@wp.pl>
Date: Sat, 5 Apr 2025 20:48:06 +0200
From: Aleksander Jan Bajkowski <olek2@...pl>
To: johannes@...solutions.net,
ilan.peer@...el.com,
christopher.a.wills@...el.com,
slakkavalli@...to.com,
john@...ozen.org,
linux-wireless@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Aleksander Jan Bajkowski <olek2@...pl>
Subject: [PATCH iw,v2 2/3] iw: fix HE operation on Big Endian platforms
IE fields are encoded in Little Endian and are not correctly
printed on Big Endian platforms.
Fixes: 422419e06d55 ("scan: Add printing of HE Operation Element")
Signed-off-by: Aleksander Jan Bajkowski <olek2@...pl>
---
util.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/util.c b/util.c
index 6502788..1870393 100644
--- a/util.c
+++ b/util.c
@@ -1755,7 +1755,7 @@ void print_he_operation(const uint8_t *ie, int len)
{
uint8_t oper_parameters[3] = {ie[0], ie[1], ie[2] };
uint8_t bss_color = ie[3];
- uint16_t nss_mcs_set = *(uint16_t*)(&ie[4]);
+ uint16_t nss_mcs_set = le16toh(*(uint16_t *)(&ie[4]));
uint8_t vht_oper_present = oper_parameters[1] & 0x40;
uint8_t co_hosted_bss_present = oper_parameters[1] & 0x80;
uint8_t uhb_operation_info_present = oper_parameters[2] & 0x02;
@@ -1768,7 +1768,7 @@ void print_he_operation(const uint8_t *ie, int len)
printf("\t\t\tTWT Required\n");
printf("\t\t\tTXOP Duration RTS Threshold: %hu\n",
- (*(uint16_t*)(oper_parameters)) >> 4 & 0x03ff);
+ le16toh((*(uint16_t *)(oper_parameters))) >> 4 & 0x03ff);
if (oper_parameters[1] & 0x40)
printf("\t\t\tVHT Operation Information Present\n");
--
2.39.5
Powered by blists - more mailing lists