From patchwork Tue Nov 15 23:31:22 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eyal Shapira X-Patchwork-Id: 125896 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 29135B6F98 for ; Wed, 16 Nov 2011 10:31:51 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 3D1219C17D; Tue, 15 Nov 2011 18:31:46 -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 XqoP-ZGzPsjT; Tue, 15 Nov 2011 18:31:45 -0500 (EST) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id DE4E19C177; Tue, 15 Nov 2011 18:31:41 -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 37AB617C017 for ; Tue, 15 Nov 2011 18:31:40 -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 4s4JwQPDJglA for ; Tue, 15 Nov 2011 18:31:36 -0500 (EST) Received: from mail-ey0-f194.google.com (mail-ey0-f194.google.com [209.85.215.194]) (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 64E9117C009 for ; Tue, 15 Nov 2011 18:31:36 -0500 (EST) Received: by eyd10 with SMTP id 10so1353266eyd.5 for ; Tue, 15 Nov 2011 15:31:35 -0800 (PST) Received: by 10.213.32.147 with SMTP id c19mr68300ebd.10.1321399895048; Tue, 15 Nov 2011 15:31:35 -0800 (PST) Received: from localhost.localdomain ([77.125.149.66]) by mx.google.com with ESMTPS id b2sm2424696fao.1.2011.11.15.15.31.31 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 15 Nov 2011 15:31:33 -0800 (PST) From: Eyal Shapira To: Subject: [PATCH] sched scan: Fix passive scanning Date: Wed, 16 Nov 2011 01:31:22 +0200 Message-Id: <1321399882-18699-1-git-send-email-eyal@wizery.com> X-Mailer: git-send-email 1.7.4.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 Scan wasn't initiated in case the config contained only networks without scan_ssid. In such a case we want scan to be initiated without any SSIDs to actively scan but include all the SSIDs in the filter list. Also added some debug logs to easily see which SSIDs were included in which list. Cc: Luciano Coelho Signed-off-by: Eyal Shapira --- wpa_supplicant/scan.c | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-) diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index e30d8eb..d6d45ee 100644 --- a/wpa_supplicant/scan.c +++ b/wpa_supplicant/scan.c @@ -710,8 +710,10 @@ int wpa_supplicant_req_sched_scan(struct wpa_supplicant *wpa_s) else max_sched_scan_ssids = wpa_s->max_sched_scan_ssids; - if (wpa_s->sched_scanning) + if (wpa_s->sched_scanning) { + wpa_dbg(wpa_s, MSG_DEBUG, "Already sched scanning"); return 0; + } os_memset(¶ms, 0, sizeof(params)); @@ -754,6 +756,8 @@ int wpa_supplicant_req_sched_scan(struct wpa_supplicant *wpa_s) } if (params.filter_ssids && ssid->ssid && ssid->ssid_len) { + wpa_dbg(wpa_s, MSG_DEBUG, "add to filter ssid: %s", + wpa_ssid_txt(ssid->ssid, ssid->ssid_len)); os_memcpy(params.filter_ssids[params.num_filter_ssids].ssid, ssid->ssid, ssid->ssid_len); params.filter_ssids[params.num_filter_ssids].ssid_len = @@ -762,6 +766,8 @@ int wpa_supplicant_req_sched_scan(struct wpa_supplicant *wpa_s) } if (ssid->scan_ssid) { + wpa_dbg(wpa_s, MSG_DEBUG, "add to active scan ssid: %s", + wpa_ssid_txt(ssid->ssid, ssid->ssid_len)); params.ssids[params.num_ssids].ssid = ssid->ssid; params.ssids[params.num_ssids].ssid_len = @@ -779,11 +785,6 @@ int wpa_supplicant_req_sched_scan(struct wpa_supplicant *wpa_s) ssid = ssid->next; } - if (!params.num_ssids) { - os_free(params.filter_ssids); - return 0; - } - if (wpa_s->wps) wps_ie = wpa_supplicant_extra_ies(wpa_s, ¶ms);