summaryrefslogtreecommitdiff
path: root/net/wireless
diff options
context:
space:
mode:
authorJUN-KYU SHIN <jk.shin@newratek.com>2022-11-11 05:33:04 +0300
committerJohannes Berg <johannes.berg@intel.com>2022-12-01 17:09:09 +0300
commitc1d3214d61d93eb4a3959c6b402230988d0f362d (patch)
tree9985811a31c8123cc539781b9f20976b1cb15ce1 /net/wireless
parent09d838a457a89883a926b8b0104d575158fd4b92 (diff)
downloadlinux-c1d3214d61d93eb4a3959c6b402230988d0f362d.tar.xz
wifi: cfg80211: fix comparison of BSS frequencies
If the "channel->freq_offset" comparison is omitted in cmp_bss(), BSS with different kHz units cannot be distinguished in the S1G Band. So "freq_offset" should also be included in the comparison. Signed-off-by: JUN-KYU SHIN <jk.shin@newratek.com> Link: https://lore.kernel.org/r/20221111023301.6395-1-jk.shin@newratek.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/scan.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index e70302a30013..a39c93753213 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -1289,7 +1289,8 @@ static int cmp_bss(struct cfg80211_bss *a,
int i, r;
if (a->channel != b->channel)
- return b->channel->center_freq - a->channel->center_freq;
+ return (b->channel->center_freq * 1000 + b->channel->freq_offset) -
+ (a->channel->center_freq * 1000 + a->channel->freq_offset);
a_ies = rcu_access_pointer(a->ies);
if (!a_ies)