]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Fix frequency in the P2P_EVENT_GROUP_STARTED event
authorJithu Jance <jithu@broadcom.com>
Fri, 28 Oct 2011 19:26:30 +0000 (22:26 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 28 Oct 2011 19:26:30 +0000 (22:26 +0300)
P2P Client did not show correct frequency in the control interface
event P2P_EVENT_GROUP_STARTED. Fix that by using the frequency from
the BSS table or association event.

wpa_supplicant/p2p_supplicant.c

index 477e0092c307b82447eeef894c7db8fba085a7f9..929d2fd23b1ec1e57be047dca48a8dd8f8e4658e 100644 (file)
@@ -3598,6 +3598,7 @@ void wpas_p2p_completed(struct wpa_supplicant *wpa_s)
        u8 go_dev_addr[ETH_ALEN];
        int network_id = -1;
        int persistent;
+       int freq;
 
        if (!wpa_s->show_group_started || !ssid)
                return;
@@ -3615,20 +3616,22 @@ void wpas_p2p_completed(struct wpa_supplicant *wpa_s)
        if (wpa_s->global->p2p_group_formation == wpa_s)
                wpa_s->global->p2p_group_formation = NULL;
 
+       freq = wpa_s->current_bss ? wpa_s->current_bss->freq :
+               (int) wpa_s->assoc_freq;
        if (ssid->passphrase == NULL && ssid->psk_set) {
                char psk[65];
                wpa_snprintf_hex(psk, sizeof(psk), ssid->psk, 32);
                wpa_msg(wpa_s->parent, MSG_INFO, P2P_EVENT_GROUP_STARTED
                        "%s client ssid=\"%s\" freq=%d psk=%s go_dev_addr="
                        MACSTR "%s",
-                       wpa_s->ifname, ssid_txt, ssid->frequency, psk,
+                       wpa_s->ifname, ssid_txt, freq, psk,
                        MAC2STR(go_dev_addr),
                        persistent ? " [PERSISTENT]" : "");
        } else {
                wpa_msg(wpa_s->parent, MSG_INFO, P2P_EVENT_GROUP_STARTED
                        "%s client ssid=\"%s\" freq=%d passphrase=\"%s\" "
                        "go_dev_addr=" MACSTR "%s",
-                       wpa_s->ifname, ssid_txt, ssid->frequency,
+                       wpa_s->ifname, ssid_txt, freq,
                        ssid->passphrase ? ssid->passphrase : "",
                        MAC2STR(go_dev_addr),
                        persistent ? " [PERSISTENT]" : "");