summaryrefslogtreecommitdiffstats
path: root/net/mac80211/scan.c
diff options
context:
space:
mode:
authorTosoni <jp.tosoni@acksys.fr>2018-03-14 17:58:34 +0100
committerJohannes Berg <johannes.berg@intel.com>2018-03-21 11:27:11 +0100
commit1ad22fb5bb53ce6bf5377f25529c0a007c61c6f5 (patch)
tree3932788cc832ac2f081e81f6588fbb1c6729bddd /net/mac80211/scan.c
parentmac80211_hwsim: fix use-after-free bug in hwsim_exit_net (diff)
downloadlinux-1ad22fb5bb53ce6bf5377f25529c0a007c61c6f5.tar.xz
linux-1ad22fb5bb53ce6bf5377f25529c0a007c61c6f5.zip
mac80211: inform wireless layer when frame RSSI is invalid
When the low-level driver returns an invalid RSSI indication, set the signal value to 0 as an indication to the upper layer. Also, skip average level computation if signal is invalid. Signed-off-by: Jean Pierre TOSONI <jp.tosoni@acksys.fr> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/scan.c')
-rw-r--r--net/mac80211/scan.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index ef2becaade50..a3b1bcc2b461 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -73,7 +73,9 @@ ieee80211_bss_info_update(struct ieee80211_local *local,
bool signal_valid;
struct ieee80211_sub_if_data *scan_sdata;
- if (ieee80211_hw_check(&local->hw, SIGNAL_DBM))
+ if (rx_status->flag & RX_FLAG_NO_SIGNAL_VAL)
+ bss_meta.signal = 0; /* invalid signal indication */
+ else if (ieee80211_hw_check(&local->hw, SIGNAL_DBM))
bss_meta.signal = rx_status->signal * 100;
else if (ieee80211_hw_check(&local->hw, SIGNAL_UNSPEC))
bss_meta.signal = (rx_status->signal * 100) / local->hw.max_signal;