From: Ilan Peer Date: Tue, 12 May 2015 14:40:01 +0000 (+0300) Subject: P2P: Fix wpas_remove_persistent_peer() to use P2P mgmt interface X-Git-Tag: hostap_2_5~700 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b740401f180b416c6d62c8cc899ed47a5df9e644;p=thirdparty%2Fhostap.git P2P: Fix wpas_remove_persistent_peer() to use P2P mgmt interface The function used wpa_s->parent->conf to iterate the P2P networks and update the configuration file. However, wpa_s->parent is not necessarily the interface used to manage the P2P Device operations. Fix this by accessing the configuration file of the interface initialized to manage the P2P Device operations. Signed-off-by: Ilan Peer --- diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index c46e3c9e8..f6f3d36f1 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -2831,6 +2831,7 @@ static void wpas_remove_persistent_peer(struct wpa_supplicant *wpa_s, const u8 *peer, int inv) { size_t i; + struct wpa_supplicant *p2p_wpa_s = wpa_s->global->p2p_init_wpa_s; if (ssid == NULL) return; @@ -2860,8 +2861,8 @@ static void wpas_remove_persistent_peer(struct wpa_supplicant *wpa_s, ssid->p2p_client_list + (i + 1) * 2 * ETH_ALEN, (ssid->num_p2p_clients - i - 1) * 2 * ETH_ALEN); ssid->num_p2p_clients--; - if (wpa_s->parent->conf->update_config && - wpa_config_write(wpa_s->parent->confname, wpa_s->parent->conf)) + if (p2p_wpa_s->conf->update_config && + wpa_config_write(p2p_wpa_s->confname, p2p_wpa_s->conf)) wpa_printf(MSG_DEBUG, "P2P: Failed to update configuration"); }