summaryrefslogtreecommitdiff
path: root/package/network/utils/iwinfo
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2013-05-12 01:12:56 +0000
committerJo-Philipp Wich <jow@openwrt.org>2013-05-12 01:12:56 +0000
commitd59f8cfa8e76079bf99a2fcc8e7ce00c0724c4bd (patch)
tree63fe61d930b725517db30a470ff2196c03c3db54 /package/network/utils/iwinfo
parentf09d89a7b1506e298a2caa0d53282ed5919d6506 (diff)
downloadmtk-20170518-d59f8cfa8e76079bf99a2fcc8e7ce00c0724c4bd.zip
mtk-20170518-d59f8cfa8e76079bf99a2fcc8e7ce00c0724c4bd.tar.gz
mtk-20170518-d59f8cfa8e76079bf99a2fcc8e7ce00c0724c4bd.tar.bz2
iwinfo: only consider joined bss when finding current operating frequency, fixes spurious misreporting of frequencies in ad-hoc mode
SVN-Revision: 36604
Diffstat (limited to 'package/network/utils/iwinfo')
-rw-r--r--package/network/utils/iwinfo/Makefile2
-rw-r--r--package/network/utils/iwinfo/src/iwinfo_nl80211.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/package/network/utils/iwinfo/Makefile b/package/network/utils/iwinfo/Makefile
index e0090e0..018832f 100644
--- a/package/network/utils/iwinfo/Makefile
+++ b/package/network/utils/iwinfo/Makefile
@@ -7,7 +7,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libiwinfo
-PKG_RELEASE:=44
+PKG_RELEASE:=45
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
PKG_CONFIG_DEPENDS := \
diff --git a/package/network/utils/iwinfo/src/iwinfo_nl80211.c b/package/network/utils/iwinfo/src/iwinfo_nl80211.c
index dd619e2..7004109 100644
--- a/package/network/utils/iwinfo/src/iwinfo_nl80211.c
+++ b/package/network/utils/iwinfo/src/iwinfo_nl80211.c
@@ -918,13 +918,14 @@ static int nl80211_get_frequency_scan_cb(struct nl_msg *msg, void *arg)
static struct nla_policy bss_policy[NL80211_BSS_MAX + 1] = {
[NL80211_BSS_FREQUENCY] = { .type = NLA_U32 },
+ [NL80211_BSS_STATUS] = { .type = NLA_U32 },
};
if (attr[NL80211_ATTR_BSS] &&
!nla_parse_nested(binfo, NL80211_BSS_MAX,
attr[NL80211_ATTR_BSS], bss_policy))
{
- if (binfo[NL80211_BSS_FREQUENCY])
+ if (binfo[NL80211_BSS_STATUS] && binfo[NL80211_BSS_FREQUENCY])
*freq = nla_get_u32(binfo[NL80211_BSS_FREQUENCY]);
}