Patchwork Use P2P_IE_VENDOR_TYPE instead of combination of OUI_WFA and P2P_OUI_TYPE

login
register
mail settings
Submitter Rahul Jain
Date Feb. 25, 2014, 12:02 p.m.
Message ID <16643744.119941393329727710.JavaMail.weblogic@epml20>
Download mbox | patch
Permalink /patch/323941/
State Superseded
Headers show

Comments

Rahul Jain - Feb. 25, 2014, 12:02 p.m.
hi, 

Patch for review

From bf40c2ab40c453fcd270e81ed8e01bf6dd0bc137 Mon Sep 17 00:00:00 2001
From: Rahul Jain <rahul.jain@samsung.com>
Date: Tue, 25 Feb 2014 17:29:10 +0530
Subject: [PATCH] Use P2P_IE_VENDOR_TYPE instead of combination of OUI_WFA and
 P2P_OUI_TYPE


Signed-off-by: Rahul Jain <rahul.jain@samsung.com>
---
 src/p2p/p2p_build.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
Jouni Malinen - Feb. 25, 2014, 1:46 p.m.
On Tue, Feb 25, 2014 at 12:02:07PM +0000, Rahul Jain wrote:
> Subject: [PATCH] Use P2P_IE_VENDOR_TYPE instead of combination of OUI_WFA and
>  P2P_OUI_TYPE

> diff --git a/src/p2p/p2p_build.c b/src/p2p/p2p_build.c
> @@ -17,8 +17,7 @@
>  void p2p_buf_add_action_hdr(struct wpabuf *buf, u8 subtype, u8 dialog_token)
>  {
>  	wpabuf_put_u8(buf, WLAN_ACTION_VENDOR_SPECIFIC);
> -	wpabuf_put_be24(buf, OUI_WFA);
> -	wpabuf_put_u8(buf, P2P_OUI_TYPE);
> +	wpabuf_put_be32(buf, P2P_IE_VENDOR_TYPE);

Why? I don't see much of a practical difference with this, but the
commit here would leave number of places within src/p2p still using the
OUI_WFA + P2P_OUI_TYPE combination, so this does not seem to make this
any more consistent that it is today.

I guess it could be justifiable to make this consistent, but in that
case, I'd expect the changes to go through all files in hostap.git and
likely also to remove P2P_OUI_TYPE define at the same time.

Patch

diff --git a/src/p2p/p2p_build.c b/src/p2p/p2p_build.c
index 664fade..e9b683d 100644
--- a/src/p2p/p2p_build.c
+++ b/src/p2p/p2p_build.c
@@ -17,8 +17,7 @@ 
 void p2p_buf_add_action_hdr(struct wpabuf *buf, u8 subtype, u8 dialog_token)
 {
 	wpabuf_put_u8(buf, WLAN_ACTION_VENDOR_SPECIFIC);
-	wpabuf_put_be24(buf, OUI_WFA);
-	wpabuf_put_u8(buf, P2P_OUI_TYPE);
+	wpabuf_put_be32(buf, P2P_IE_VENDOR_TYPE);
 
 	wpabuf_put_u8(buf, subtype); /* OUI Subtype */
 	wpabuf_put_u8(buf, dialog_token);
@@ -31,8 +30,7 @@  void p2p_buf_add_public_action_hdr(struct wpabuf *buf, u8 subtype,
 {
 	wpabuf_put_u8(buf, WLAN_ACTION_PUBLIC);
 	wpabuf_put_u8(buf, WLAN_PA_VENDOR_SPECIFIC);
-	wpabuf_put_be24(buf, OUI_WFA);
-	wpabuf_put_u8(buf, P2P_OUI_TYPE);
+	wpabuf_put_be32(buf, P2P_IE_VENDOR_TYPE);
 
 	wpabuf_put_u8(buf, subtype); /* OUI Subtype */
 	wpabuf_put_u8(buf, dialog_token);
@@ -47,8 +45,7 @@  u8 * p2p_buf_add_ie_hdr(struct wpabuf *buf)
 	/* P2P IE header */
 	wpabuf_put_u8(buf, WLAN_EID_VENDOR_SPECIFIC);
 	len = wpabuf_put(buf, 1); /* IE length to be filled */
-	wpabuf_put_be24(buf, OUI_WFA);
-	wpabuf_put_u8(buf, P2P_OUI_TYPE);
+	wpabuf_put_be32(buf, P2P_IE_VENDOR_TYPE);
 	wpa_printf(MSG_DEBUG, "P2P: * P2P IE header");
 	return len;
 }