Do not add P2P IE into Beacon/Probe Response if P2P is disabled

P2P IE was incorrectly added in wpa_supplicant AP mode even if P2P
function was not actually enabled.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2011-11-14 16:26:45 +02:00 committed by Jouni Malinen
parent 04ed4e984e
commit adc33680e3
1 changed files with 6 additions and 0 deletions

View File

@ -22,6 +22,7 @@
#include "wps/wps_i.h"
#include "p2p/p2p.h"
#include "ap/hostapd.h"
#include "ap/ap_config.h"
#include "ap/p2p_hostapd.h"
#include "eapol_supp/eapol_supp_sm.h"
#include "rsn_supp/wpa.h"
@ -3176,6 +3177,11 @@ static void wpas_p2p_ie_update(void *ctx, struct wpabuf *beacon_ies,
struct wpa_supplicant *wpa_s = ctx;
if (wpa_s->ap_iface) {
struct hostapd_data *hapd = wpa_s->ap_iface->bss[0];
if (!(hapd->conf->p2p & P2P_GROUP_OWNER)) {
wpabuf_free(beacon_ies);
wpabuf_free(proberesp_ies);
return;
}
if (beacon_ies) {
wpabuf_free(hapd->p2p_beacon_ie);
hapd->p2p_beacon_ie = beacon_ies;