From patchwork Thu Jun 30 22:26:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roshan Pius X-Patchwork-Id: 642790 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rgZ0D6Fybz9t0p for ; Fri, 1 Jul 2016 08:26:52 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bIkPp-0003UL-7G; Thu, 30 Jun 2016 22:26:33 +0000 Received: from [2620:0:1000:1500:6168:e664:f60b:74c0] (helo=rpius-linux.mtv.corp.google.com) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bIkPo-0003K1-07 for hostap@lists.infradead.org; Thu, 30 Jun 2016 22:26:32 +0000 Received: from rpius-linux.mtv.corp.google.com (localhost [127.0.0.1]) by rpius-linux.mtv.corp.google.com (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id u5UMQAgT038152; Thu, 30 Jun 2016 15:26:10 -0700 Received: (from rpius@localhost) by rpius-linux.mtv.corp.google.com (8.14.4/8.14.4/Submit) id u5UMQ9vp038150; Thu, 30 Jun 2016 15:26:09 -0700 From: Roshan Pius To: hostap@lists.infradead.org Subject: [RESEND PATCH] Dont exceed scan ssid max size advertised by driver Date: Thu, 30 Jun 2016 15:26:07 -0700 Message-Id: <1467325567-38100-1-git-send-email-rpius@google.com> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 In-Reply-To: <20160630190705.GA26847@w1.fi> References: <20160630190705.GA26847@w1.fi> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160630_152632_054855_0D8D11CA X-CRM114-Status: UNSURE ( 7.79 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.5 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (0.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.0 DKIM_ADSP_CUSTOM_MED No valid author signature, adsp_override is CUSTOM_MED -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.8 RDNS_NONE Delivered to internal network by a host with no rDNS 0.9 NML_ADSP_CUSTOM_MED ADSP custom_med hit, and not from a mailing list X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Roshan Pius MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Currently |wpa_set_scan_ssids| fully exhausts |wpa_driver_scan_params.ssid| list when hidden network ID's are provided via the control interface. This results in us exceeding the max size for the list advertised by the driver when we add the "wildcard" scan ssid entry. So, ensure that we leave space for one more scan ssid entry in the list when we exit out of |wpa_set_scan_ssids|. Signed-off-by: Roshan Pius --- wpa_supplicant/scan.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index 7a52826..7f42607 100644 --- a/wpa_supplicant/scan.c +++ b/wpa_supplicant/scan.c @@ -575,6 +575,11 @@ static void wpa_set_scan_ssids(struct wpa_supplicant *wpa_s, { unsigned int i; struct wpa_ssid *ssid; + /* + * For devices with |max_ssids| greater than 1, leave the last slot empty + * for adding the wildcard scan entry. + */ + max_ssids = (max_ssids == 1) ? max_ssids : max_ssids - 1; for (i = 0; i < wpa_s->scan_id_count; i++) { unsigned int j;