cfg80211: Address some corner cases in scan result channel updating
authorJouni Malinen <jouni@codeaurora.org>
Wed, 5 Sep 2018 15:52:22 +0000 (18:52 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 10 Sep 2018 07:13:09 +0000 (09:13 +0200)
commit119f94a6fefcc76d47075b83d2b73d04c895df78
tree9e4961b9a37065065ef15d29a166e7f7d06d4fc4
parent6eae4a6c2be387fec41b0d2782c4fffb57159498
cfg80211: Address some corner cases in scan result channel updating

cfg80211_get_bss_channel() is used to update the RX channel based on the
available frame payload information (channel number from DSSS Parameter
Set element or HT Operation element). This is needed on 2.4 GHz channels
where frames may be received on neighboring channels due to overlapping
frequency range.

This might of some use on the 5 GHz band in some corner cases, but
things are more complex there since there is no n:1 or 1:n mapping
between channel numbers and frequencies due to multiple different
starting frequencies in different operating classes. This could result
in ieee80211_channel_to_frequency() returning incorrect frequency and
ieee80211_get_channel() returning incorrect channel information (or
indication of no match). In the previous implementation, this could
result in some scan results being dropped completely, e.g., for the 4.9
GHz channels. That prevented connection to such BSSs.

Fix this by using the driver-provided channel pointer if
ieee80211_get_channel() does not find matching channel data for the
channel number in the frame payload and if the scan is done with 5 MHz
or 10 MHz channel bandwidth. While doing this, also add comments
describing what the function is trying to achieve to make it easier to
understand what happens here and why.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/scan.c