]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Update peer WFD IE from PD Response and GO Negotiation Response
authorAvichal Agarwal <avichal.a@samsung.com>
Fri, 4 Mar 2016 02:38:26 +0000 (11:38 +0900)
committerJouni Malinen <j@w1.fi>
Sat, 5 Mar 2016 08:02:59 +0000 (10:02 +0200)
Update the peer WFD IE information based on WFD elements received in
Provision Discovery Response and GO Negotiation Response frames.

Signed-off-by: Avichal Agarwal <avichal.a@samsung.com>
Signed-off-by: Kyeong-Chae Lim <kcya.lim@samsung.com>
src/p2p/p2p_go_neg.c
src/p2p/p2p_pd.c

index fe0096f14c9029ee74e5901e06bf9967239be509..9f0b3f3d37a44799eca35514c7c90fa109f0fd05 100644 (file)
@@ -1268,6 +1268,11 @@ void p2p_process_go_neg_resp(struct p2p_data *p2p, const u8 *sa,
                dev->client_timeout = msg.config_timeout[1];
        }
 
+       if (msg.wfd_subelems) {
+               wpabuf_free(dev->info.wfd_subelems);
+               dev->info.wfd_subelems = wpabuf_dup(msg.wfd_subelems);
+       }
+
        if (!msg.operating_channel && !go) {
                /*
                 * Note: P2P Client may omit Operating Channel attribute to
index e6535d411bcd87cc3f30cc7dc9ecfd70bb6398b4..93a0535f873a0d5474b351ad75a6daaaa03f0072 100644 (file)
@@ -1349,6 +1349,9 @@ void p2p_process_prov_disc_resp(struct p2p_data *p2p, const u8 *sa,
                        " with no pending request", MAC2STR(sa));
                p2p_parse_free(&msg);
                return;
+       } else if (msg.wfd_subelems) {
+               wpabuf_free(dev->info.wfd_subelems);
+               dev->info.wfd_subelems = wpabuf_dup(msg.wfd_subelems);
        }
 
        if (dev->dialog_token != msg.dialog_token) {