P2PS: Allow p2p_build_ssid() to use pre-set SSID
authorKrishna Vamsi <vamsin@qti.qualcomm.com>
Wed, 10 Dec 2014 10:14:18 +0000 (15:44 +0530)
committerJouni Malinen <j@w1.fi>
Mon, 2 Feb 2015 23:35:06 +0000 (01:35 +0200)
This is needed to allow P2PS PD to prepare SSID for the group.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/p2p/p2p.c

index 1847cf5..5a7352a 100644 (file)
@@ -1735,7 +1735,14 @@ void p2p_build_ssid(struct p2p_data *p2p, u8 *ssid, size_t *ssid_len)
 
 int p2p_go_params(struct p2p_data *p2p, struct p2p_go_neg_results *params)
 {
-       p2p_build_ssid(p2p, params->ssid, &params->ssid_len);
+       if (p2p->ssid_set) {
+               os_memcpy(params->ssid, p2p->ssid, p2p->ssid_len);
+               params->ssid_len = p2p->ssid_len;
+       } else {
+               p2p_build_ssid(p2p, params->ssid, &params->ssid_len);
+       }
+       p2p->ssid_set = 0;
+
        p2p_random(params->passphrase, p2p->cfg->passphrase_len);
        return 0;
 }