mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-25 00:38:24 -05:00
Use throughput estimate-based BSS selection with larger SNR difference
Previously, the est_throughput comparison was done only when SNR difference was less than 5 dB. Since the throughput estimation take into account SNR, this can be done in more cases. For now, add a conservative 2 dB more to the difference so that any SNR difference below 7 dB results in BSS selection based on throughput estimates. In addition, the throughput estimates require SNR values to be available, so separate this from the 5 GHz preference that can be done based on either SNR or qual values. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
1420414878
commit
b4d56efb1a
@ -1841,10 +1841,12 @@ static int wpa_scan_result_compar(const void *a, const void *b)
|
||||
}
|
||||
|
||||
/* if SNR is close, decide by max rate or frequency band */
|
||||
if ((snr_a && snr_b && abs(snr_b - snr_a) < 5) ||
|
||||
(wa->qual && wb->qual && abs(wb->qual - wa->qual) < 10)) {
|
||||
if (snr_a && snr_b && abs(snr_b - snr_a) < 7) {
|
||||
if (wa->est_throughput != wb->est_throughput)
|
||||
return wb->est_throughput - wa->est_throughput;
|
||||
}
|
||||
if ((snr_a && snr_b && abs(snr_b - snr_a) < 5) ||
|
||||
(wa->qual && wb->qual && abs(wb->qual - wa->qual) < 10)) {
|
||||
if (IS_5GHZ(wa->freq) ^ IS_5GHZ(wb->freq))
|
||||
return IS_5GHZ(wa->freq) ? -1 : 1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user