From patchwork Sun Feb 16 23:25:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Cameron X-Patchwork-Id: 3659061 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5167CBF13A for ; Sun, 16 Feb 2014 23:26:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 69D62201F0 for ; Sun, 16 Feb 2014 23:26:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DF21B201E4 for ; Sun, 16 Feb 2014 23:26:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753454AbaBPX0L (ORCPT ); Sun, 16 Feb 2014 18:26:11 -0500 Received: from zimbra.real-time.com ([63.170.91.9]:59681 "EHLO zimbra.real-time.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752322AbaBPX0L (ORCPT ); Sun, 16 Feb 2014 18:26:11 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.real-time.com (Postfix) with ESMTP id 0E3164C6236; Sun, 16 Feb 2014 17:26:10 -0600 (CST) X-Virus-Scanned: amavisd-new at mn.real-time.com Received: from zimbra.real-time.com ([127.0.0.1]) by localhost (zimbra.real-time.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0+lXm28bh+Ca; Sun, 16 Feb 2014 17:26:09 -0600 (CST) Received: from esk.lan (CPE-121-217-201-73.lnse3.cht.bigpond.net.au [121.217.201.73]) by zimbra.real-time.com (Postfix) with ESMTPSA id E42A14C6232; Sun, 16 Feb 2014 17:26:08 -0600 (CST) Received: from james by esk.lan with local (Exim 4.80) (envelope-from ) id 1WFB5t-0000nQ-Ag; Mon, 17 Feb 2014 10:25:53 +1100 Date: Mon, 17 Feb 2014 10:25:53 +1100 From: James Cameron To: libertas-dev@lists.infradead.org, linux-wireless@vger.kernel.org, "John W. Linville" Cc: Dan Williams , T Gillett Subject: [PATCH] libertas: fix scan result loss if SSID IE len 0 Message-ID: <20140216232553.GA2991@us.netrek.org> MIME-Version: 1.0 Content-Disposition: inline Organization: Netrek Vanilla Server Dictator User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Scan results from Marvell 8388 and 8686 have probe responses from hidden APs and OLPC XO-1 mesh with a zero length SSID IE. Bug in lbs_ret_scan discarded any remaining BSS in scan response, leading to user not seeing APs in dense environments. With LBS_DEB_SCAN, dmesg shows libertas scan: scan response: 5 BSSs (419 bytes); resp size 474 bytes libertas scan: scan: 00:1a:2b:84:de:e8, capa 0401, chan 1, qz, -51 dBm libertas scan: scan: 5c:63:bf:d8:eb:0c, capa 0411, chan 1, qw129, -23 dBm libertas scan: scan response: invalid IE fmt With LBS_DEB_HEX, dmesg shows valid BSS in scan response were not processed. Change is to ignore zero length IE and continue processing. Fixes OLPC 12757, http://dev.laptop.org/ticket/12757 Signed-off-by: James Cameron Reported-by: T Gillett Tested-by: T Gillett CC: Dan Williams --- drivers/net/wireless/libertas/cfg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c index 32f7500..cb6d189 100644 --- a/drivers/net/wireless/libertas/cfg.c +++ b/drivers/net/wireless/libertas/cfg.c @@ -621,7 +621,7 @@ static int lbs_ret_scan(struct lbs_private *priv, unsigned long dummy, id = *pos++; elen = *pos++; left -= 2; - if (elen > left || elen == 0) { + if (elen > left) { lbs_deb_scan("scan response: invalid IE fmt\n"); goto done; }