iwinfo: only consider joined bss when finding current operating frequency, fixes spurious misreporting of frequencies in ad-hoc mode

SVN-Revision: 36604
owl
Jo-Philipp Wich 2013-05-12 01:12:56 +00:00
parent f09d89a7b1
commit d59f8cfa8e
2 changed files with 3 additions and 2 deletions

View File

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

View File

@ -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] = { static struct nla_policy bss_policy[NL80211_BSS_MAX + 1] = {
[NL80211_BSS_FREQUENCY] = { .type = NLA_U32 }, [NL80211_BSS_FREQUENCY] = { .type = NLA_U32 },
[NL80211_BSS_STATUS] = { .type = NLA_U32 },
}; };
if (attr[NL80211_ATTR_BSS] && if (attr[NL80211_ATTR_BSS] &&
!nla_parse_nested(binfo, NL80211_BSS_MAX, !nla_parse_nested(binfo, NL80211_BSS_MAX,
attr[NL80211_ATTR_BSS], bss_policy)) 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]); *freq = nla_get_u32(binfo[NL80211_BSS_FREQUENCY]);
} }