Patchwork P2P: Do not append WPS and P2P IE for the interface not support P2P

login
register
mail settings
Submitter Stone Piao
Date Oct. 25, 2012, 2:59 a.m.
Message ID <E62404B31D39064FBDD0B843ADF05A7D2D39A02374@SC-VEXCH4.marvell.com>
Download mbox | patch
Permalink /patch/194018/
State Rejected
Headers show

Comments

Stone Piao - Oct. 25, 2012, 2:59 a.m.
Hi All,

When we start wpa_supplicant on one interface and we do not issue WPS_PBC or WPS_PIN cmd on wpa_cli to activate WPS, then there is no WPS IE in the probe requests. However, if we start wpa_supplicant to control two interfaces and one of them supports P2P feature, then all the probe requests will contain WPS and P2P IE even if we do not activate WPS. So the following patch is generated to fix this.

Any comments are appreciated, thanks a lot.

From c5336ef55d4fc05396c68aeec16ba427d8c8941e Mon Sep 17 00:00:00 2001
From: Stone Piao <piaoyun@marvell.com>
Date: Wed, 24 Oct 2012 13:52:58 -0400
Subject: [PATCH] P2P: Do not append WPS and P2P IE for the interface not support P2P

When start one wpa_supplicant to control two interfaces and the first one is only supports WPS and the other one supports both WPS and P2P, we should not append WPS and P2P IE on the first one when it is not in WPS active mode, or there will be WPS and P2P IE in the probe request from the first interface all the time.

Signed-off-by: Stone Piao <piaoyun@marvell.com>
---
 wpa_supplicant/scan.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

--
Jouni Malinen - Oct. 28, 2012, 7:18 p.m.
On Wed, Oct 24, 2012 at 07:59:00PM -0700, Stone Piao wrote:
> When we start wpa_supplicant on one interface and we do not issue WPS_PBC or WPS_PIN cmd on wpa_cli to activate WPS, then there is no WPS IE in the probe requests. However, if we start wpa_supplicant to control two interfaces and one of them supports P2P feature, then all the probe requests will contain WPS and P2P IE even if we do not activate WPS. So the following patch is generated to fix this.

The P2P information is added by design to make P2P device discovery
somewhat faster by allowing the non-P2P scans to be used, too. If you
want to disable this, you can use the per-interface p2p_disabled=1
parameter to do so for the interfaces that won't be used for P2P
operations.

Patch

diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index 68bdc59..59c7864 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -66,7 +66,8 @@  static int wpas_wps_in_use(struct wpa_supplicant *wpa_s,
      }

 #ifdef CONFIG_P2P
-      if (!wpa_s->global->p2p_disabled && wpa_s->global->p2p &&
+     if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_P2P_CAPABLE &&
+            !wpa_s->global->p2p_disabled && wpa_s->global->p2p &&
          !wpa_s->conf->p2p_disabled) {
             wpa_s->wps->dev.p2p = 1;
             if (!wps) {