From patchwork Thu Mar 7 09:26:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: dvdspndl@gmail.com X-Patchwork-Id: 225773 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "maxx.shmoo.com", Issuer "CA Cert Signing Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 23B1F2C0394 for ; Thu, 7 Mar 2013 20:26:30 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 8CC199C157; Thu, 7 Mar 2013 04:26:27 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id woC54SKbjfAW; Thu, 7 Mar 2013 04:26:27 -0500 (EST) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 73A269C155; Thu, 7 Mar 2013 04:26:22 -0500 (EST) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id DAD829C157 for ; Thu, 7 Mar 2013 04:26:21 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XgRBOTXHluYQ for ; Thu, 7 Mar 2013 04:26:18 -0500 (EST) Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by maxx.maxx.shmoo.com (Postfix) with ESMTPS id A605B9C158 for ; Thu, 7 Mar 2013 04:26:13 -0500 (EST) Received: by mail-wg0-f50.google.com with SMTP id es5so343734wgb.29 for ; Thu, 07 Mar 2013 01:26:12 -0800 (PST) X-Received: by 10.180.104.225 with SMTP id gh1mr31445239wib.27.1362648372522; Thu, 07 Mar 2013 01:26:12 -0800 (PST) Received: from localhost (93-172-33-149.bb.netvision.net.il. [93.172.33.149]) by mx.google.com with ESMTPS id ej8sm31948730wib.9.2013.03.07.01.26.11 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 07 Mar 2013 01:26:12 -0800 (PST) From: David Spinadel To: hostap@lists.shmoo.com Subject: [PATCH] wpa_supplicant: don't allow too short sched scan Date: Thu, 7 Mar 2013 11:26:10 +0200 Message-Id: <1362648370-3084-1-git-send-email-dvdspndl@gmail.com> X-Mailer: git-send-email 1.7.10.msysgit.1 X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com From: David Spinadel In case that the ssid list is longer than max number of ssids, ths scheduled scan aborted after timeout and rescheduled again with shorter timeout and longer interval. In case that the timeout is shorter than the interval, only one scan iteration will be run. In this case, start again the initial times. Signed-hostap: David Spinadel --- wpa_supplicant/scan.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index 0e45079..ce33d0c 100644 --- a/wpa_supplicant/scan.c +++ b/wpa_supplicant/scan.c @@ -1118,6 +1118,10 @@ scan: wpa_s->first_sched_scan = 0; wpa_s->sched_scan_timeout /= 2; wpa_s->sched_scan_interval *= 2; + if (wpa_s->sched_scan_timeout < wpa_s->sched_scan_interval) { + wpa_s->sched_scan_interval = 10; + wpa_s->sched_scan_timeout = max_sched_scan_ssids * 2; + } } /* If there is no more ssids, start next time from the beginning */