diff options
author | jow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2013-05-12 01:12:56 +0000 |
---|---|---|
committer | jow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2013-05-12 01:12:56 +0000 |
commit | c2a2d3fa85efa4b27335d595fc05c5fc3519b150 (patch) | |
tree | 096499243f4492a068a615fb3ad5ebb426c2d8ce /package/network/utils/iwinfo/src | |
parent | 37471206763f0e922d3e1995b39f7c5a0af624c2 (diff) |
iwinfo: only consider joined bss when finding current operating frequency, fixes spurious misreporting of frequencies in ad-hoc mode
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36604 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/network/utils/iwinfo/src')
-rw-r--r-- | package/network/utils/iwinfo/src/iwinfo_nl80211.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/package/network/utils/iwinfo/src/iwinfo_nl80211.c b/package/network/utils/iwinfo/src/iwinfo_nl80211.c index dd619e2d6f..700410939d 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]); } |