Commit c1d3214d authored by JUN-KYU SHIN's avatar JUN-KYU SHIN Committed by Johannes Berg

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: default avatarJUN-KYU SHIN <jk.shin@newratek.com>
Link: https://lore.kernel.org/r/20221111023301.6395-1-jk.shin@newratek.comSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 09d838a4
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment