WPS: Close p2p_group and temporary parameters to all network blocks
authorJouni Malinen <j@w1.fi>
Sun, 13 Apr 2014 08:44:57 +0000 (11:44 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 13 Apr 2014 08:44:57 +0000 (11:44 +0300)
If a P2P GO issues multiple credentials for some reason, clone the
p2p_group and temporary parameters to all those based on the initial
network block that gets used for the first credential.

Signed-off-by: Jouni Malinen <j@w1.fi>
wpa_supplicant/wps_supplicant.c

index 22b8e71..4c729dd 100644 (file)
@@ -370,6 +370,17 @@ static int wpa_supplicant_wps_cred(void *ctx,
                ssid = wpa_config_add_network(wpa_s->conf);
                if (ssid == NULL)
                        return -1;
+               if (wpa_s->current_ssid) {
+                       /*
+                        * Should the GO issue multiple credentials for some
+                        * reason, each credential should be marked as a
+                        * temporary P2P group similarly to the one that gets
+                        * marked as such based on the pre-configured values
+                        * used for the WPS network block.
+                        */
+                       ssid->p2p_group = wpa_s->current_ssid->p2p_group;
+                       ssid->temporary = wpa_s->current_ssid->temporary;
+               }
                wpas_notify_network_added(wpa_s, ssid);
        }