]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
dbus: Use current_bss to get correct group BSSID and frequency on client
authorJintao Lin <jintaolin@chromium.org>
Thu, 21 Dec 2023 22:25:35 +0000 (22:25 +0000)
committerJouni Malinen <j@w1.fi>
Sat, 23 Dec 2023 09:41:37 +0000 (11:41 +0200)
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 <jintaolin@chromium.org>
wpa_supplicant/dbus/dbus_new_handlers_p2p.c

index a178d879ea2b427ce69775e374c8a38e683952af..f805ffe204519564a944bc1f38589851b902e96c 100644 (file)
@@ -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;