From patchwork Thu Mar 3 23:39:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Otcheretianski X-Patchwork-Id: 1600699 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=GLpcqVyD; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=B8BrTSyM; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4K8nYC3HzNz9sGC for ; Fri, 4 Mar 2022 10:40:42 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :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=WxxVGfX/xvfsCb4c/AriNbbJjjDFDaMkJv+h8zhk5kU=; b=GLpcqVyDGN4bZW /Z2/c2OA3GfQaPsEOYj69Ommt3pgAR8FvRq3SLwkMtUWUubr4dGtYluMhpvfQn/U/5Sb8fvTq+1ac 154v6ZMpDi2kYWr+WLB9o8fNS7GPUOo+xTnpZR6BB+jtxvBVtgP0v69POOkmS/PHAg9Z/CWmhZ+L7 u9XkIbf6dD/aYJlaXHWm9R7b3myNLVhrx0ot9Zq9vq+oF2hauF+bFrivFtbs3bbKjEvGLuKeMTi6d G0FSiktbmI+NuBoHl03vffqYT9QxiKd9N386+tVpIG1KPhmdBSr5UFzrw1oV4anxuuyKu/3F9ITfA uHvuFvkyKDQQxmdNV4RA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nPv2i-00867h-3s; Thu, 03 Mar 2022 23:39:32 +0000 Received: from mga05.intel.com ([192.55.52.43]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nPv2e-00867J-8P for hostap@lists.infradead.org; Thu, 03 Mar 2022 23:39:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646350768; x=1677886768; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=7ztPQZ2dvlDYEKEI6KCa09cLtixnDQ95LjXh39afFN8=; b=B8BrTSyMGmTreHoGGlXec73T4N6S6JS4tWWqCRd6Ik5einwDV2uTBHOq z/crTTq7Pjqm3TTQ0+Vs6N/dS4k939xBzat4I9Blkip7XLSDHCCDPdtIv XsBYfOgmdGfmv7HL7wDKJCsX8A1erzlkbXoPpLmgblYIbEPLkvLs0oqZ/ OBj759zNDrlRNhCZt2b+pDzKIV3HcTXKxYl3TFCcc7Tz0XMyQUpPBl0q6 CdxzAIcLu1LFCR49+cbjNl9APTHrdN8ode4EKRWmFXm/fbwDXap0KwIKw USMPlCHxuxhebEdKgwn4TIygkBN3cLzhzhTKT+4jXICnoKw9C/KtXiN9o Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10275"; a="340277176" X-IronPort-AV: E=Sophos;i="5.90,153,1643702400"; d="scan'208";a="340277176" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2022 15:39:25 -0800 X-IronPort-AV: E=Sophos;i="5.90,153,1643702400"; d="scan'208";a="551980206" Received: from meitalnx-mobl.ger.corp.intel.com (HELO aotchere-desk.intel.com) ([10.254.148.203]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2022 15:39:23 -0800 From: Andrei Otcheretianski To: hostap@lists.infradead.org Cc: Avraham Stern Subject: [PATCH] RRM: include passive channels in active beacon report scan Date: Fri, 4 Mar 2022 01:39:03 +0200 Message-Id: <20220303233903.2787228-1-andrei.otcheretianski@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220303_153928_340382_8F44D40D X-CRM114-Status: GOOD ( 12.33 ) X-Spam-Score: -2.7 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Avraham Stern When receiving a beacon report request with the mode set to active, channels that are marked as NO_IR were not added to the scan request. However, active mode just mean that active scan is allowed, bu [...] Content analysis details: (-2.7 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [192.55.52.43 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.2 DKIMWL_WL_HIGH DKIMwl.org - High trust sender X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Avraham Stern When receiving a beacon report request with the mode set to active, channels that are marked as NO_IR were not added to the scan request. However, active mode just mean that active scan is allowed, but not that it is a must, so these channels should not be omitted. Include channels that are marked as NO_IR in the scan request even if the mode is set to active. Signed-off-by: Avraham Stern --- wpa_supplicant/rrm.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/wpa_supplicant/rrm.c b/wpa_supplicant/rrm.c index cf107ebaf6..cc86db655f 100644 --- a/wpa_supplicant/rrm.c +++ b/wpa_supplicant/rrm.c @@ -501,7 +501,7 @@ static int wpas_add_channel(u8 op_class, u8 chan, u8 num_primary_channels, static int * wpas_add_channels(const struct oper_class_map *op, - struct hostapd_hw_modes *mode, int active, + struct hostapd_hw_modes *mode, const u8 *channels, const u8 size) { int *freqs, *next_freq; @@ -532,7 +532,7 @@ static int * wpas_add_channels(const struct oper_class_map *op, enum chan_allowed res = verify_channel(mode, op->op_class, chan, op->bw); - if (res == NOT_ALLOWED || (res == NO_IR && active)) + if (res == NOT_ALLOWED) continue; if (wpas_add_channel(op->op_class, chan, num_primary_channels, @@ -554,7 +554,7 @@ static int * wpas_add_channels(const struct oper_class_map *op, static int * wpas_op_class_freqs(const struct oper_class_map *op, - struct hostapd_hw_modes *mode, int active) + struct hostapd_hw_modes *mode) { u8 channels_80mhz_5ghz[] = { 42, 58, 106, 122, 138, 155, 171 }; u8 channels_160mhz_5ghz[] = { 50, 114, 163 }; @@ -581,11 +581,11 @@ static int * wpas_op_class_freqs(const struct oper_class_map *op, ARRAY_SIZE(channels_160mhz_5ghz); } - return wpas_add_channels(op, mode, active, channels, num_chan); + return wpas_add_channels(op, mode, channels, num_chan); } -static int * wpas_channel_report_freqs(struct wpa_supplicant *wpa_s, int active, +static int * wpas_channel_report_freqs(struct wpa_supplicant *wpa_s, const char *country, const u8 *subelems, size_t len) { @@ -633,7 +633,7 @@ static int * wpas_channel_report_freqs(struct wpa_supplicant *wpa_s, int active, * by a corresponding AP Channel Report element as specified in * IEEE Std 802.11-2016, 11.11.9.1. */ - new_freqs = wpas_add_channels(op, mode, active, pos, left); + new_freqs = wpas_add_channels(op, mode, pos, left); if (new_freqs) int_array_concat(&freqs, new_freqs); @@ -648,7 +648,7 @@ out: static int * wpas_beacon_request_freqs(struct wpa_supplicant *wpa_s, - u8 op_class, u8 chan, int active, + u8 op_class, u8 chan, const u8 *subelems, size_t len) { int *freqs = NULL, *ext_freqs = NULL; @@ -678,7 +678,7 @@ static int * wpas_beacon_request_freqs(struct wpa_supplicant *wpa_s, switch (chan) { case 0: - freqs = wpas_op_class_freqs(op, mode, active); + freqs = wpas_op_class_freqs(op, mode); if (!freqs) return NULL; break; @@ -686,13 +686,13 @@ static int * wpas_beacon_request_freqs(struct wpa_supplicant *wpa_s, /* freqs will be added from AP channel subelements */ break; default: - freqs = wpas_add_channels(op, mode, active, &chan, 1); + freqs = wpas_add_channels(op, mode, &chan, 1); if (!freqs) return NULL; break; } - ext_freqs = wpas_channel_report_freqs(wpa_s, active, country, subelems, + ext_freqs = wpas_channel_report_freqs(wpa_s, country, subelems, len); if (ext_freqs) { int_array_concat(&freqs, ext_freqs); @@ -1220,10 +1220,9 @@ wpas_rm_handle_beacon_req(struct wpa_supplicant *wpa_s, goto out; } - params->freqs = wpas_beacon_request_freqs( - wpa_s, req->oper_class, req->channel, - req->mode == BEACON_REPORT_MODE_ACTIVE, - req->variable, len - sizeof(*req)); + params->freqs = wpas_beacon_request_freqs(wpa_s, req->oper_class, + req->channel, req->variable, + len - sizeof(*req)); if (!params->freqs) { wpa_printf(MSG_DEBUG, "Beacon request: No valid channels"); reject_mode = MEASUREMENT_REPORT_MODE_REJECT_REFUSED;