3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-10-04 02:18:49 +02:00

scan: use signal strength if bss ranks are equal

If two BSS's end up with the same rank sort them based on signal
strength so IWD still prefers the higher strength BSS.
This commit is contained in:
James Prestwood 2021-11-08 11:39:29 -08:00 committed by Denis Kenzior
parent f85fc4202a
commit ea23556a40

View File

@ -1628,6 +1628,10 @@ int scan_bss_rank_compare(const void *a, const void *b, void *user_data)
{
const struct scan_bss *new_bss = a, *bss = b;
if (bss->rank == new_bss->rank)
return (bss->signal_strength >
new_bss->signal_strength) ? 1 : -1;
return (bss->rank > new_bss->rank) ? 1 : -1;
}