From 35986959d9f4c40d37e9c6292946a98aa12e3223 Mon Sep 17 00:00:00 2001 From: Avichal Agarwal Date: Fri, 4 Mar 2016 11:38:26 +0900 Subject: [PATCH] P2P: Update peer WFD IE from PD Response and GO Negotiation Response 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 Signed-off-by: Kyeong-Chae Lim --- src/p2p/p2p_go_neg.c | 5 +++++ src/p2p/p2p_pd.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/p2p/p2p_go_neg.c b/src/p2p/p2p_go_neg.c index fe0096f14..9f0b3f3d3 100644 --- a/src/p2p/p2p_go_neg.c +++ b/src/p2p/p2p_go_neg.c @@ -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 diff --git a/src/p2p/p2p_pd.c b/src/p2p/p2p_pd.c index e6535d411..93a0535f8 100644 --- a/src/p2p/p2p_pd.c +++ b/src/p2p/p2p_pd.c @@ -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) {