Patchwork bgscan_learn: Prevent infinte busy looping

login
register
mail settings
Submitter Pawel Kulakowski
Date Nov. 5, 2012, 9:07 a.m.
Message ID <1352106424-16834-1-git-send-email-pawel.kulakowski@tieto.com>
Download mbox | patch
Permalink /patch/197165/
State Accepted
Commit 548f100384137562535bc47a010ea2cab07e3da7
Headers show

Comments

Pawel Kulakowski - Nov. 5, 2012, 9:07 a.m.
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 fulfill:
"if (!in_array(freqs, data->supp_freqs[idx]))"

Signed-hostap: Pawel Kulakowski <pawel.kulakowski@tieto.com>
---
 wpa_supplicant/bgscan_learn.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
Jouni Malinen - Nov. 11, 2012, 2:27 p.m.
On Mon, Nov 05, 2012 at 10:07:04AM +0100, Pawel Kulakowski wrote:
> 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 fulfill:
> "if (!in_array(freqs, data->supp_freqs[idx]))"

Thanks! Applied.
Piotr.Nakraszewicz@tieto.com - Nov. 12, 2012, 10:02 a.m.
On 11/11/12 15:27, Jouni Malinen wrote:
> On Mon, Nov 05, 2012 at 10:07:04AM +0100, Pawel Kulakowski wrote:
>> 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 fulfill:
>> "if (!in_array(freqs, data->supp_freqs[idx]))"
> Thanks! Applied.
>

Hi Jouni,

We had this bug after many weeks of using bgscan learn.
Its database only grows, the entries are never removed.
Please consider again this patch:
http://patchwork.ozlabs.org/patch/169799/
or please propose different solution to remove entries.
Otherwise after some time bgscan learn database is full and main 
advantage of bgscan learn - scanning only on particular channels - 
disappears.

BR
Piotr

Patch

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]);