P2P: Use the P2P Device management interface in wpas_p2p_remove_client()
authorBen Rosenfeld <ben.rosenfeld@intel.com>
Tue, 12 May 2015 14:39:57 +0000 (17:39 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 25 May 2015 15:31:09 +0000 (18:31 +0300)
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 <ben.rosenfeld@intel.com>
wpa_supplicant/p2p_supplicant.c

index 2ccc5ea..d4ff3e3 100644 (file)
@@ -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 */