aboutsummaryrefslogtreecommitdiffstats
path: root/package/iwinfo/src/iwinfo_nl80211.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2012-03-21 19:47:16 +0000
committerJo-Philipp Wich <jow@openwrt.org>2012-03-21 19:47:16 +0000
commitd1bd1b4e27af0ac48f19c4156ecd9313fcfc07b5 (patch)
tree81e197cccd4d8dc55fc9f506ba21045ffc3b0764 /package/iwinfo/src/iwinfo_nl80211.c
parent1d2b19c4bff442c1b05669dfa9f15869aa4141b1 (diff)
downloadupstream-d1bd1b4e27af0ac48f19c4156ecd9313fcfc07b5.tar.gz
upstream-d1bd1b4e27af0ac48f19c4156ecd9313fcfc07b5.tar.bz2
upstream-d1bd1b4e27af0ac48f19c4156ecd9313fcfc07b5.zip
iwinfo: properly cast nl80211 mBm signal levels to reported dBm values (#11161)
SVN-Revision: 31053
Diffstat (limited to 'package/iwinfo/src/iwinfo_nl80211.c')
-rw-r--r--package/iwinfo/src/iwinfo_nl80211.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/package/iwinfo/src/iwinfo_nl80211.c b/package/iwinfo/src/iwinfo_nl80211.c
index bd3a60b0ac..704049007a 100644
--- a/package/iwinfo/src/iwinfo_nl80211.c
+++ b/package/iwinfo/src/iwinfo_nl80211.c
@@ -1541,7 +1541,8 @@ static int nl80211_get_scanlist_cb(struct nl_msg *msg, void *arg)
if (bss[NL80211_BSS_SIGNAL_MBM])
{
- sl->e->signal = nla_get_u32(bss[NL80211_BSS_SIGNAL_MBM]) / 100;
+ sl->e->signal =
+ (uint8_t)((int32_t)nla_get_u32(bss[NL80211_BSS_SIGNAL_MBM]) / 100);
rssi = sl->e->signal - 0x100;