mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-28 18:28:23 -05:00
Make min_diff determination from cur_level more readable
This handles both the dBm and unspecified unit cases. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
41f72d7356
commit
a8ad9c31db
@ -1817,19 +1817,18 @@ static int wpa_supplicant_need_to_roam(struct wpa_supplicant *wpa_s,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
min_diff = 2;
|
if (cur_level < -85) /* ..-86 dBm */
|
||||||
if (cur_level < 0) {
|
min_diff = 1;
|
||||||
if (cur_level < -85)
|
else if (cur_level < -80) /* -85..-81 dBm */
|
||||||
min_diff = 1;
|
min_diff = 2;
|
||||||
else if (cur_level < -80)
|
else if (cur_level < -75) /* -80..-76 dBm */
|
||||||
min_diff = 2;
|
min_diff = 3;
|
||||||
else if (cur_level < -75)
|
else if (cur_level < -70) /* -75..-71 dBm */
|
||||||
min_diff = 3;
|
min_diff = 4;
|
||||||
else if (cur_level < -70)
|
else if (cur_level < 0) /* -70..-1 dBm */
|
||||||
min_diff = 4;
|
min_diff = 5;
|
||||||
else
|
else /* unspecified units (not in dBm) */
|
||||||
min_diff = 5;
|
min_diff = 2;
|
||||||
}
|
|
||||||
|
|
||||||
if (cur_est > sel_est * 1.5)
|
if (cur_est > sel_est * 1.5)
|
||||||
min_diff += 10;
|
min_diff += 10;
|
||||||
|
Loading…
Reference in New Issue
Block a user