]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Make sure wpa_s->global->p2p_group_formation gets cleared
authorJouni Malinen <jouni.malinen@atheros.com>
Thu, 18 Nov 2010 10:41:27 +0000 (12:41 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 18 Nov 2010 10:41:27 +0000 (12:41 +0200)
This pointer is now used in number of places to check whether an
interface is in P2P Group Formation, so we better make sure it gets
cleared when group formation has been completed. This was done in
only some of the cases.

wpa_supplicant/p2p_supplicant.c

index f12156799cb38f38eeea39bd643f6118e6e234ba..fe96ff4576ee0a1daa26bbe0a386b069a65cbec8 100644 (file)
@@ -422,6 +422,7 @@ static void wpas_group_formation_completed(struct wpa_supplicant *wpa_s,
         */
        if (wpa_s->global->p2p_group_formation)
                wpa_s = wpa_s->global->p2p_group_formation;
+       wpa_s->global->p2p_group_formation = NULL;
        wpa_s->p2p_in_provisioning = 0;
 
        if (!success) {
@@ -782,6 +783,8 @@ static void p2p_go_configured(void *ctx, void *data)
        ssid = wpa_s->current_ssid;
        if (ssid && ssid->mode == WPAS_MODE_P2P_GO) {
                wpa_printf(MSG_DEBUG, "P2P: Group setup without provisioning");
+               if (wpa_s->global->p2p_group_formation == wpa_s)
+                       wpa_s->global->p2p_group_formation = NULL;
                wpa_msg(wpa_s->parent, MSG_INFO, P2P_EVENT_GROUP_STARTED
                        "%s GO ssid=\"%s\" freq=%d passphrase=\"%s\" "
                        "go_dev_addr=" MACSTR "%s",