aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/bgscan_learn.c
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2013-12-19 10:03:25 (GMT)
committerJouni Malinen <j@w1.fi>2013-12-24 04:54:34 (GMT)
commit3e06180fe0f47e0263bb1fb8ba97174f26802e52 (patch)
tree3cd69de02c7fb231a0f2fc729a9872e1089d7423 /wpa_supplicant/bgscan_learn.c
parentf4c73ae6408a4a6b385cb56be10106dfed21bb3f (diff)
downloadhostap-3e06180fe0f47e0263bb1fb8ba97174f26802e52.zip
hostap-3e06180fe0f47e0263bb1fb8ba97174f26802e52.tar.gz
hostap-3e06180fe0f47e0263bb1fb8ba97174f26802e52.tar.bz2
bgscan_learn: Start scanning from the first freq
bgscan_learn_get_probe_freq() starts from returning the second entry in the supp_freqs arrays. Change its logic a bit to make it start from the first entry. Signed-hostap: Eliad Peller <eliad@wizery.com>
Diffstat (limited to 'wpa_supplicant/bgscan_learn.c')
-rw-r--r--wpa_supplicant/bgscan_learn.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/wpa_supplicant/bgscan_learn.c b/wpa_supplicant/bgscan_learn.c
index 6fd81c2..fa0475d 100644
--- a/wpa_supplicant/bgscan_learn.c
+++ b/wpa_supplicant/bgscan_learn.c
@@ -240,17 +240,14 @@ static int * bgscan_learn_get_probe_freq(struct bgscan_learn_data *data,
if (data->supp_freqs == NULL)
return freqs;
- idx = data->probe_idx + 1;
- while (idx != data->probe_idx) {
- if (data->supp_freqs[idx] == 0) {
- if (data->probe_idx == 0)
- break;
- idx = 0;
- }
+ idx = data->probe_idx;
+ do {
if (!in_array(freqs, data->supp_freqs[idx])) {
wpa_printf(MSG_DEBUG, "bgscan learn: Probe new freq "
"%u", data->supp_freqs[idx]);
- data->probe_idx = idx;
+ data->probe_idx = idx + 1;
+ if (data->supp_freqs[data->probe_idx] == 0)
+ data->probe_idx = 0;
n = os_realloc_array(freqs, count + 2, sizeof(int));
if (n == NULL)
return freqs;
@@ -262,7 +259,9 @@ static int * bgscan_learn_get_probe_freq(struct bgscan_learn_data *data,
}
idx++;
- }
+ if (data->supp_freqs[idx] == 0)
+ idx = 0;
+ } while (idx != data->probe_idx);
return freqs;
}