From 4839da4d4fd84955383b3a758a97718879b6f709 Mon Sep 17 00:00:00 2001 From: Sunil Dutt Date: Sun, 14 Jun 2015 17:25:56 +0530 Subject: [PATCH] P2P: Add vendor elements into Invitation Response frames Commit 86bd36f0d5b3d359075c356d68977b4d2e7c9f71 ('Add generic mechanism for adding vendor elements into frames') introduced a mechanism to add vendor elements into various frames, but missed the addition to the Invitation Response frame. This commit addresses the same. Signed-off-by: Jouni Malinen --- src/p2p/p2p_invitation.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/p2p/p2p_invitation.c b/src/p2p/p2p_invitation.c index 44a6bbfd3..f5454f704 100644 --- a/src/p2p/p2p_invitation.c +++ b/src/p2p/p2p_invitation.c @@ -134,6 +134,9 @@ static struct wpabuf * p2p_build_invitation_resp(struct p2p_data *p2p, extra = wpabuf_len(wfd_ie); #endif /* CONFIG_WIFI_DISPLAY */ + if (p2p->vendor_elem && p2p->vendor_elem[VENDOR_ELEM_P2P_INV_RESP]) + extra += wpabuf_len(p2p->vendor_elem[VENDOR_ELEM_P2P_INV_RESP]); + buf = wpabuf_alloc(1000 + extra); if (buf == NULL) return NULL; @@ -158,6 +161,9 @@ static struct wpabuf * p2p_build_invitation_resp(struct p2p_data *p2p, wpabuf_put_buf(buf, wfd_ie); #endif /* CONFIG_WIFI_DISPLAY */ + if (p2p->vendor_elem && p2p->vendor_elem[VENDOR_ELEM_P2P_INV_RESP]) + wpabuf_put_buf(buf, p2p->vendor_elem[VENDOR_ELEM_P2P_INV_RESP]); + return buf; }