From: Ben Rosenfeld Date: Tue, 12 May 2015 14:39:57 +0000 (+0300) Subject: P2P: Use the P2P Device management interface in wpas_p2p_remove_client() X-Git-Tag: hostap_2_5~703 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=43677494fbdcb672ec5e0e6c05f319e2128e665a;p=thirdparty%2Fhostap.git P2P: Use the P2P Device management interface in wpas_p2p_remove_client() As wpas_p2p_remove_client() is not necessarily called from the interface used to manage the P2P Device operations, when removing a client, use the P2P management interface to iterate over the saved networks and remove the relevant entries form the P2P GO network blocks. Signed-off-by: Ben Rosenfeld --- diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 2ccc5ea3e..d4ff3e33d 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -7309,16 +7309,17 @@ void wpas_p2p_remove_client(struct wpa_supplicant *wpa_s, const u8 *peer, { struct wpa_ssid *s; struct wpa_supplicant *w; + struct wpa_supplicant *p2p_wpa_s = wpa_s->global->p2p_init_wpa_s; wpa_dbg(wpa_s, MSG_DEBUG, "P2P: Remove client " MACSTR, MAC2STR(peer)); /* Remove from any persistent group */ - for (s = wpa_s->parent->conf->ssid; s; s = s->next) { + for (s = p2p_wpa_s->conf->ssid; s; s = s->next) { if (s->disabled != 2 || s->mode != WPAS_MODE_P2P_GO) continue; if (!iface_addr) - wpas_remove_persistent_peer(wpa_s, s, peer, 0); - wpas_p2p_remove_psk(wpa_s->parent, s, peer, iface_addr); + wpas_remove_persistent_peer(p2p_wpa_s, s, peer, 0); + wpas_p2p_remove_psk(p2p_wpa_s, s, peer, iface_addr); } /* Remove from any operating group */