diff mbox series

Use current_bss to get correct group BSSID and frequency on the P2P group client side

Message ID 20231221222535.3875476-1-jintaolin@chromium.org
State Accepted
Headers show
Series Use current_bss to get correct group BSSID and frequency on the P2P group client side | expand

Commit Message

Jintao Lin Dec. 21, 2023, 10:25 p.m. UTC
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 <jintaolin@chromium.org>
---
 wpa_supplicant/dbus/dbus_new_handlers_p2p.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Comments

Jouni Malinen Dec. 23, 2023, 10:41 a.m. UTC | #1
On Thu, Dec 21, 2023 at 10:25:35PM +0000, Jintao Lin wrote:
> 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.

Thanks, applied.
diff mbox series

Patch

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;