From patchwork Thu Dec 21 22:25:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jintao Lin X-Patchwork-Id: 1879478 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=GTttjpov; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=EwSaUMDY; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Sx4mM5GQjz1ydZ for ; Fri, 22 Dec 2023 09:26:57 +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=Wb54jTGsUUMCaz59TxlBFNEl4XlfpeC2lJByExga+D8=; b=GTttjpovIasW9M qR2a86FUpaK3Ue/c93nqwJ7r7F/o8E78pH1LhKu3q4dKy2/Eai9ajsdb/wxT5zRwtE1oa+kkN6Rdh ODTPsfLk74eD7KyxbAamNbj/h84+PL2K3VzQD+z3L5qfOmXZ6UZqlGnqyIk6DD/IwN5c0ASGRq2oM O7gGkJTGv0shHev1v/cCgSc5c7/7MlD4WCnP/e/3CkPAkFMJppE8HuSFlYoQE6IzYxvwgtBSLPzLx VBezoXU3a5IsuWInnxJIbND0BhLdlzjHt6tqkwtmbMlvEZhhAALgVz3+v6PvFo44K2mI8PHK+6jDx 0gb6LR+EG3Wm1ij6WbjA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rGRUO-004J8z-0e; Thu, 21 Dec 2023 22:26:00 +0000 Received: from mail-oo1-xc2c.google.com ([2607:f8b0:4864:20::c2c]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rGRUK-004J89-2E for hostap@lists.infradead.org; Thu, 21 Dec 2023 22:25:58 +0000 Received: by mail-oo1-xc2c.google.com with SMTP id 006d021491bc7-5941d4fc664so706411eaf.0 for ; Thu, 21 Dec 2023 14:25:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1703197554; x=1703802354; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=mPyueMY0WYycHlwDZZtDmfzjanvdPd4Z37P8ZPZPkbM=; b=EwSaUMDY34Brh7RqW5s/viXSKCBijA2jVVyUG9Ndi002WXpSA1XvUWM98VaJUroQr6 vls/dM6qPomi/1LiLU+swMpIxB6ujBiXsOrgAtwL7AJgcTZzKKlXMGobRsg2wqyBQ6Dx xBMD7X+ZQp6jhcRWkxFeQd7wi3ihktuFqcZrs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703197554; x=1703802354; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=mPyueMY0WYycHlwDZZtDmfzjanvdPd4Z37P8ZPZPkbM=; b=NP2DRqboAEgBfoAnuQpdGrCvn5n7Mf2X+6D1PlNoWQUlSHKOPr2sMCgFkiBGqVB4OP 31gzps0Ej6ZbtkRdf86MfHJ/oje1ceaJR3dhaz2LThdxt83kcmJB3qXz3DN2/1sNcfVX Uotp5LX5MehGPudF/W8NqV9wsJjJPQsB807vKeEYvgyYENJiWy49o1AdLgojhXKn2z5F cjKL8PwPwivu0tf0HMmzf+4C4x/d4HMUFyaQAiiWovK6ub7++fZjUWQFwR8qOIMuePdc vg9XC9Xlq6MDcc8wTD0RuDElndB4QLHPnU3V9Hdoog6EUsZWY4d7KD0wFoBNCxsgxHyI rZ+g== X-Gm-Message-State: AOJu0Yz3558kAaljIjLMBFtGdLIMbtz2saO1BN6xsTRqYE2mGNprIAQq mg367drSrCPVrTUsV60F4HXSNIYHbHYFy1NI1F447acWWQ== X-Google-Smtp-Source: AGHT+IGpU7MORNYNZ8hTH4zE7LX/8IElvkJi7wMvzTHPyN7qd1ucUseWTBHsC46naPJIRdsS7smOOQ== X-Received: by 2002:a05:6358:7f0d:b0:174:c7d3:6729 with SMTP id p13-20020a0563587f0d00b00174c7d36729mr557477rwn.34.1703197554548; Thu, 21 Dec 2023 14:25:54 -0800 (PST) Received: from jintaolin.c.googlers.com.com (200.42.168.34.bc.googleusercontent.com. [34.168.42.200]) by smtp.gmail.com with ESMTPSA id y12-20020a056a00190c00b006d082dd8086sm2063489pfi.214.2023.12.21.14.25.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 14:25:54 -0800 (PST) From: Jintao Lin To: hostap@lists.infradead.org Cc: j@w1.fi, jintaolin@chromium.org Subject: [PATCH] Use current_bss to get correct group BSSID and frequency on the P2P group client side Date: Thu, 21 Dec 2023 22:25:35 +0000 Message-ID: <20231221222535.3875476-1-jintaolin@chromium.org> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231221_142556_742773_2D081CCF X-CRM114-Status: GOOD ( 12.07 ) X-Spam-Score: -0.4 (/) 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: When the P2P persistent group is privisioned out-of-band, I.E., add persisten group with known BSSID, SSID, passphrase and frequency and start the group with GroupAdd dbus command, the group info fetc [...] Content analysis details: (-0.4 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:c2c listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO 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 When the P2P persistent group is privisioned out-of-band, I.E., add persisten group with known BSSID, SSID, passphrase and frequency and start the group with GroupAdd dbus command, the group info fetched on the cliend side has zero MAC address for BSSID and no value for frequency. This change fix this issue by getting those information from wpa_s->current_bss. Signed-off-by: Jintao Lin --- wpa_supplicant/dbus/dbus_new_handlers_p2p.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/wpa_supplicant/dbus/dbus_new_handlers_p2p.c b/wpa_supplicant/dbus/dbus_new_handlers_p2p.c index 4bd754095..007a0c410 100644 --- a/wpa_supplicant/dbus/dbus_new_handlers_p2p.c +++ b/wpa_supplicant/dbus/dbus_new_handlers_p2p.c @@ -14,6 +14,7 @@ #include "../wpa_supplicant_i.h" #include "../wps_supplicant.h" #include "../notify.h" +#include "../bss.h" #include "dbus_new_helpers.h" #include "dbus_new.h" #include "dbus_new_handlers.h" @@ -2482,9 +2483,9 @@ dbus_bool_t wpas_dbus_getter_p2p_group_bssid( u8 *p_bssid; if (role == WPAS_P2P_ROLE_CLIENT) { - if (wpa_s->current_ssid == NULL) + if (wpa_s->current_bss == NULL) return FALSE; - p_bssid = wpa_s->current_ssid->bssid; + p_bssid = wpa_s->current_bss->bssid; } else { if (wpa_s->ap_iface == NULL) return FALSE; @@ -2506,9 +2507,9 @@ dbus_bool_t wpas_dbus_getter_p2p_group_frequency( u8 role = wpas_get_p2p_role(wpa_s); if (role == WPAS_P2P_ROLE_CLIENT) { - if (wpa_s->go_params == NULL) + if (wpa_s->current_bss == NULL) return FALSE; - op_freq = wpa_s->go_params->freq; + op_freq = wpa_s->current_bss->freq; } else { if (wpa_s->ap_iface == NULL) return FALSE;