From patchwork Wed Nov 30 13:09:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Otcheretianski X-Patchwork-Id: 1710492 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: legolas.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=svAs1/6t; 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=JJxbg5GC; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NMfkD10YLz23nv for ; Thu, 1 Dec 2022 00:12:04 +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:References:In-Reply-To: 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: List-Owner; bh=fVbNj+TOAaI3rtLP5LUQAtgbyp+1p6AZeNlJ2JU7C3g=; b=svAs1/6tW50DKU u0ZUAilOX5NrVkmcMezU2L5sFep1ymZ0FE57GBWvY0lRI5c5465tHtw/13oWHWx4OcGzZbfrGqCsV 9ihYIpaA/lwa2NM3xNLniDs4WJKZWzMLDg/O6QKxH6fVigYpl8c1uCYrbkFgVk7/3MgPxgis9wEhP EMbWdQY5oId/amkj+R3Dsr3c11k845BGQ02haZAD9CohpRw07O+A4wCCAt09Y1HyOR8F/P4HfTqmG ptPlOFpEIUpICoXPgy4N+l9vpqCj3N/tStI0SaZuSu012yRt04rGhfWO4IYvIiL43e2A8yGjJDZsm fbtWKGPyiw6awLI3p2wA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p0Mru-00GMV2-5b; Wed, 30 Nov 2022 13:11:18 +0000 Received: from mga03.intel.com ([134.134.136.65]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p0Mr7-00GM8L-9y for hostap@lists.infradead.org; Wed, 30 Nov 2022 13:10:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669813829; x=1701349829; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=zB8DOqaLUlsakbjrDUaQi1w9fxA6QQpDzsKFDwuyQBY=; b=JJxbg5GCw3jDOuB++ZCcowIIwk65fClYkGM2Fc8D2kB4S6d8Sy46uKs7 kxHgHV0YLJwlT/6InqPvlWW/CEI+/d+sQT1gXk/+5XgLxoxm3/d0fX+6d luE8rUKAamHuLDGoj6SH515xF4sy6U8DRHM+s+z/EjRyaJ7AIDJXYJjPh bFmCcy3PfLSWN6lyLsivrqtHWapuaXgDisA4iZ7+8vSb1kLoJYssHuFCN KI2hTefHOUaGXRGscpjWyURdTeKAP0yc0Or2wXnxWs3ZuhC9iHw36PC4R NO5fFIpwgkHAXlWWtFXBZxQuLwzgkgtYdjYB+7fdK7bKd5gZ29mJWeN9o g==; X-IronPort-AV: E=McAfee;i="6500,9779,10546"; a="317238693" X-IronPort-AV: E=Sophos;i="5.96,206,1665471600"; d="scan'208";a="317238693" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2022 05:10:28 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10546"; a="973098097" X-IronPort-AV: E=Sophos;i="5.96,206,1665471600"; d="scan'208";a="973098097" Received: from ddori-mobl.ger.corp.intel.com (HELO aotchere-desk.intel.com) ([10.254.147.54]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2022 05:10:27 -0800 From: Andrei Otcheretianski To: hostap@lists.infradead.org Cc: Andrei Otcheretianski Subject: [PATCH v2 06/15] wpa_supplicant: make valid_links u16 Date: Wed, 30 Nov 2022 15:09:30 +0200 Message-Id: <20221130130939.115928-7-andrei.otcheretianski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221130130939.115928-1-andrei.otcheretianski@intel.com> References: <20221130130939.115928-1-andrei.otcheretianski@intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221130_051029_427686_284524B0 X-CRM114-Status: GOOD ( 12.59 ) 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: MAX_NUM_MLD_LINKS is 15, thus u8 isn't enough for the bitmap. Fix it. While at it, clean mlo information better. Signed-off-by: Andrei Otcheretianski --- wpa_supplicant/events.c | 7 +++---- wpa_supplicant/wpa_supplicant_i.h | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions( [...] 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 [134.134.136.65 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 MAX_NUM_MLD_LINKS is 15, thus u8 isn't enough for the bitmap. Fix it. While at it, clean mlo information better. Signed-off-by: Andrei Otcheretianski --- wpa_supplicant/events.c | 7 +++---- wpa_supplicant/wpa_supplicant_i.h | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index fe8ab50ff3..69e8034340 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -310,14 +310,13 @@ void wpa_supplicant_stop_countermeasures(void *eloop_ctx, void *sock_ctx) static void wpas_reset_mlo_info(struct wpa_supplicant *wpa_s) { - int i; - if (!wpa_s->valid_links) return; wpa_s->valid_links = 0; - for (i = 0; i < MAX_NUM_MLD_LINKS; i++) - wpa_s->links[i].bss = NULL; + wpa_s->mlo_assoc_link_id = 0; + os_memset(wpa_s->ap_mld_addr, 0, ETH_ALEN); + os_memset(wpa_s->links, 0, sizeof(wpa_s->links)); } diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h index 0cc8633eea..f10674de49 100644 --- a/wpa_supplicant/wpa_supplicant_i.h +++ b/wpa_supplicant/wpa_supplicant_i.h @@ -687,8 +687,8 @@ struct wpa_supplicant { unsigned int assoc_freq; u8 ap_mld_addr[ETH_ALEN]; u8 mlo_assoc_link_id; - u8 valid_links; /* bitmap of valid MLO link IDs */ - struct { + u16 valid_links; /* bitmap of valid MLO link IDs */ + struct ml_sta_link_info { u8 addr[ETH_ALEN]; u8 bssid[ETH_ALEN]; unsigned int freq;