From adc33680e33ff22781bed803d79f9c0410ee5473 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 14 Nov 2011 16:26:45 +0200 Subject: [PATCH] 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 --- wpa_supplicant/p2p_supplicant.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 3723c50f7..f3108c45f 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -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;