From: Jithu Jance Date: Fri, 28 Oct 2011 19:26:30 +0000 (+0300) Subject: P2P: Fix frequency in the P2P_EVENT_GROUP_STARTED event X-Git-Tag: hostap-1-bp~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b49d6ccb74f2f2ec7c1dce4d28fd855e6840f599;p=thirdparty%2Fhostap.git P2P: Fix frequency in the P2P_EVENT_GROUP_STARTED event 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. --- diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 477e0092c..929d2fd23 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -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]" : "");