From e3570f5e1cc601ec723c49c0aa53df5f331ae012 Mon Sep 17 00:00:00 2001 From: Jintao Lin Date: Thu, 21 Dec 2023 22:25:35 +0000 Subject: [PATCH] dbus: Use current_bss to get correct group BSSID and frequency on client When the P2P persistent group is provisioned out-of-band, i.e., add persistent group with a 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. Fix this issue by getting that information from wpa_s->current_bss instead of wpa_s->go_params. 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 a178d879e..f805ffe20 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" @@ -2427,9 +2428,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) 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; @@ -2451,9 +2452,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) 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;