2018-10-04 09:34:32

by Grumbach, Emmanuel

[permalink] [raw]
Subject: [PATCH] iw: fix the beacon average signal parsing

NL80211_STA_INFO_BEACON_SIGNAL_AVG is parsed as a u8, but
it should be casted to a int8_t before being printed.

Change-Id: Ieb6fab3b803d8ea82819a450f07cc4b537d8de8b
Signed-off-by: Emmanuel Grumbach <[email protected]>
---
station.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/station.c b/station.c
index 4885dc0..f4e0093 100644
--- a/station.c
+++ b/station.c
@@ -317,7 +317,7 @@ static int print_sta_handler(struct nl_msg *msg, void *arg)

if (sinfo[NL80211_STA_INFO_BEACON_SIGNAL_AVG])
printf("\n\tbeacon signal avg:\t%d dBm",
- nla_get_u8(sinfo[NL80211_STA_INFO_BEACON_SIGNAL_AVG]));
+ (int8_t)nla_get_u8(sinfo[NL80211_STA_INFO_BEACON_SIGNAL_AVG]));
if (sinfo[NL80211_STA_INFO_T_OFFSET])
printf("\n\tToffset:\t%llu us",
(unsigned long long)nla_get_u64(sinfo[NL80211_STA_INFO_T_OFFSET]));
--
2.7.4