aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/bgscan_learn.c
diff options
context:
space:
mode:
authorPawel Kulakowski <pawel.kulakowski@tieto.com>2012-11-11 14:26:36 (GMT)
committerJouni Malinen <j@w1.fi>2012-11-11 14:26:36 (GMT)
commit548f100384137562535bc47a010ea2cab07e3da7 (patch)
tree597bcbc2d566fbd0c75586532e93e3c800360c38 /wpa_supplicant/bgscan_learn.c
parent99276998fa26d4299825eeafb6386fe1c51f6287 (diff)
downloadhostap-548f100384137562535bc47a010ea2cab07e3da7.zip
hostap-548f100384137562535bc47a010ea2cab07e3da7.tar.gz
hostap-548f100384137562535bc47a010ea2cab07e3da7.tar.bz2
bgscan_learn: Prevent infinite busy looping
In highly congested network (BSSes almost on every channel within ESS) we have hit a bug when wpa_supplicant become completly irresponsive, infinite looping on while loop. When probe_idx was equal 0 and we are not able to probe new frequency, following condition were never fulfilled: "if (!in_array(freqs, data->supp_freqs[idx]))" Signed-hostap: Pawel Kulakowski <pawel.kulakowski@tieto.com>
Diffstat (limited to 'wpa_supplicant/bgscan_learn.c')
-rw-r--r--wpa_supplicant/bgscan_learn.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/wpa_supplicant/bgscan_learn.c b/wpa_supplicant/bgscan_learn.c
index adf82d8..07d31e4 100644
--- a/wpa_supplicant/bgscan_learn.c
+++ b/wpa_supplicant/bgscan_learn.c
@@ -242,8 +242,11 @@ static int * bgscan_learn_get_probe_freq(struct bgscan_learn_data *data,
idx = data->probe_idx + 1;
while (idx != data->probe_idx) {
- if (data->supp_freqs[idx] == 0)
+ if (data->supp_freqs[idx] == 0) {
+ if (data->probe_idx == 0)
+ break;
idx = 0;
+ }
if (!in_array(freqs, data->supp_freqs[idx])) {
wpa_printf(MSG_DEBUG, "bgscan learn: Probe new freq "
"%u", data->supp_freqs[idx]);