iwinfo: properly cast nl80211 mBm signal levels to reported dBm values (#11161)
authorJo-Philipp Wich <jow@openwrt.org>
Wed, 21 Mar 2012 19:47:16 +0000 (19:47 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Wed, 21 Mar 2012 19:47:16 +0000 (19:47 +0000)
SVN-Revision: 31053

package/iwinfo/Makefile
package/iwinfo/src/iwinfo_nl80211.c

index db8a3da25f35b6465da22456ba3ef440a9a58831..5fd04d3d15a7bdf0a3902c93f1ce17d869c430a0 100644 (file)
@@ -7,7 +7,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libiwinfo
-PKG_RELEASE:=32
+PKG_RELEASE:=33
 
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 PKG_CONFIG_DEPENDS := \
index bd3a60b0ac3460018de2c601d6f52eb2f4fe97cb..704049007ae31957217f4c576b9161a7e396a29a 100644 (file)
@@ -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;