From patchwork Thu Aug 27 22:59:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Pedersen X-Patchwork-Id: 1352939 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=adapt-ip.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=D/QoZ1V9; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Bcyqh5ZJmz9sTC for ; Fri, 28 Aug 2020 09:00:16 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=5jUGjhslIwdKAIjb71MGAU+tOAWjb17SG8GwOfdqQ88=; b=D/QoZ1V9esB6/hBfAbpOBRrWYZ O52v5JoA8uvBLX7vTBeL/eCLUEV9l2NsOTm+CFCQl5ImrnSflaRy4mRwlIhZ1lAFRWCqwy7iyM5Ep qkI5BK1miZZumCwjX2fYLSvH9x3RMCGiWI2Qd1FVBDRaxYiDxkh42lc+2y6QR5vlEfzjOSkutZtWt TbMNn6CN2ei9ZuIoXvl8GR6I+IgsWC7Lf+Y2cCcg/bwSa5ZwGaMnR1tK+c1JoHCEwoiXDK+kI1zj+ zVg95sz485DsYyBZbV/YMmJDOD0AM/OP7TB5En4xKRBjR4pLHQlCSja09pZz4qtju7Rd2VX39bM82 if8GBVWA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBQrz-0003b9-1T; Thu, 27 Aug 2020 22:59:47 +0000 Received: from mail.adapt-ip.com ([173.164.178.19] helo=web.adapt-ip.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBQrv-0003aA-VG for hostap@lists.infradead.org; Thu, 27 Aug 2020 22:59:44 +0000 Received: from localhost (localhost [127.0.0.1]) by web.adapt-ip.com (Postfix) with ESMTP id 3472D4F808F; Thu, 27 Aug 2020 22:59:43 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at web.adapt-ip.com Received: from web.adapt-ip.com ([127.0.0.1]) by localhost (web.adapt-ip.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id tdnxtdzjeGHu; Thu, 27 Aug 2020 22:59:40 +0000 (UTC) Received: from atlas.campbell.adapt-ip.com (gateway.adapt-ip.com [173.164.178.20]) (Authenticated sender: thomas@adapt-ip.com) by web.adapt-ip.com (Postfix) with ESMTPSA id 94D874F807A; Thu, 27 Aug 2020 22:59:40 +0000 (UTC) From: Thomas Pedersen To: Jouni Malinen Subject: [PATCH] nl80211: unbreak mode processing due to presence of S1G band Date: Thu, 27 Aug 2020 15:59:40 -0700 Message-Id: <20200827225940.18151-1-thomas@adapt-ip.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200827_185944_100624_655F1904 X-CRM114-Status: GOOD ( 11.82 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Pedersen , hostap Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org if kernel advertises a band with channels < 2.4GHz hostap gets confused and assumes they're 11b, corrupting the real 11b band info. Signed-off-by: Thomas Pedersen --- src/drivers/driver_nl80211_capa.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c index 46f61fdbf925..625fe5d0bc5e 100644 --- a/src/drivers/driver_nl80211_capa.c +++ b/src/drivers/driver_nl80211_capa.c @@ -1946,7 +1946,10 @@ wpa_driver_nl80211_postprocess_modes(struct hostapd_hw_modes *modes, for (m = 0; m < *num_modes; m++) { if (!modes[m].num_channels) continue; - if (modes[m].channels[0].freq < 4000) { + if (modes[m].channels[0].freq < 2000) { + modes[m].num_channels = 0; + continue; + } else if (modes[m].channels[0].freq < 4000) { modes[m].mode = HOSTAPD_MODE_IEEE80211B; for (i = 0; i < modes[m].num_rates; i++) { if (modes[m].rates[i] > 200) {