diff mbox

updating wfd IE in provision discovery responce and in go negotioan responce

Message ID 1803838766.171181457060261176.JavaMail.weblogic@ep2mlwas03b
State Accepted
Headers show

Commit Message

Avichal Agarwal March 4, 2016, 2:57 a.m. UTC
From df94a5945f3fbd1999a07177ab75eaf6751fc0dc Mon Sep 17 00:00:00 2001
From: Avichal Agarwal <avichal.a@samsung.com>
Date: Fri, 4 Mar 2016 11:38:26 +0900
Subject: [PATCH] updating wfd IE in provision discovery responce and in go
 negotioan responce

this patch will update the wfd IE at remote end
which are sent in pd responce as well as in go neg responce

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 |    5 ++++-
 src/p2p/p2p_pd.c     |    4 ++++
 2 files changed, 8 insertions(+), 1 deletion(-)

Comments

Jouni Malinen March 5, 2016, 4:09 p.m. UTC | #1
On Fri, Mar 04, 2016 at 02:57:41AM +0000, Avichal Agarwal wrote:
> this patch will update the wfd IE at remote end
> which are sent in pd responce as well as in go neg responce

Thanks, applied.
diff mbox

Patch

diff --git a/src/p2p/p2p_go_neg.c b/src/p2p/p2p_go_neg.c
index fe0096f..3736d90 100644
--- a/src/p2p/p2p_go_neg.c
+++ b/src/p2p/p2p_go_neg.c
@@ -1161,7 +1161,10 @@  void p2p_process_go_neg_resp(struct p2p_data *p2p, const u8 *sa,
 
 	if (p2p_parse(data, len, &msg))
 		return;
-
+        if (msg.wfd_subelems) {
+		wpabuf_free(dev->info.wfd_subelems);
+		dev->info.wfd_subelems = wpabuf_dup(msg.wfd_subelems);
+	}
 	if (!(dev->flags & P2P_DEV_WAIT_GO_NEG_RESPONSE)) {
 		p2p_dbg(p2p, "Was not expecting GO Negotiation Response - ignore");
 		p2p_parse_free(&msg);
diff --git a/src/p2p/p2p_pd.c b/src/p2p/p2p_pd.c
index e6535d4..6fbab99 100644
--- a/src/p2p/p2p_pd.c
+++ b/src/p2p/p2p_pd.c
@@ -1350,6 +1350,10 @@  void p2p_process_prov_disc_resp(struct p2p_data *p2p, const u8 *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) {
 		p2p_dbg(p2p, "Ignore Provision Discovery Response with unexpected Dialog Token %u (expected %u)",