1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-11-23 23:32:49 +02:00

[package] iwinfo: fix integer overflow in assoclist rate reporting (#11073)

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@30825 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
jow 2012-03-05 17:52:46 +00:00
parent f4c4e108b2
commit 9ca54da839
3 changed files with 4 additions and 3 deletions

View File

@ -7,7 +7,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libiwinfo
PKG_RELEASE:=31
PKG_RELEASE:=32
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
PKG_CONFIG_DEPENDS := \

View File

@ -61,7 +61,7 @@ extern const char *IWINFO_OPMODE_NAMES[];
struct iwinfo_rate_entry {
uint16_t rate;
uint32_t rate;
int8_t mcs;
uint8_t is_40mhz:1;
uint8_t is_short_gi:1;

View File

@ -134,7 +134,8 @@ static char * format_rate(int rate)
if (rate <= 0)
snprintf(buf, sizeof(buf), "unknown");
else
snprintf(buf, sizeof(buf), "%.1f MBit/s", ((float)rate / 1000.0));
snprintf(buf, sizeof(buf), "%d.%d MBit/s",
rate / 1000, (rate % 1000) / 100);
return buf;
}