[PATCH] P2P: Do not append WPS and P2P IE for the interface not su=

Stone Piao piaoyun at marvell.com
Wed Oct 24 13:52:58 EDT 2012


pport P2P

When start one wpa_supplicant to control two interfaces and the first one i=
s 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 mod=
e, or there will be WPS and P2P IE in the probe request from the first inte=
rface all the time.

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

diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index 68bdc59..5=
9c7864 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 =3D 1;
             if (!wps) {
--



--_000_E62404B31D39064FBDD0B843ADF05A7D2D39A02374SCVEXCH4marve_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" xmlns:w=3D"urn:sc=
hemas-microsoft-com:office:word" xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:&#23435;&#20307;;
	panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
	{font-family:"\@&#23435;&#20307;";
	panose-1:2 1 6 0 3 1 1 1 1 1;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	font-size:10.5pt;
	font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:Arial;
	color:windowtext;}
 /* Page Definitions */
 @page Section1
	{size:612.0pt 792.0pt;
	margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
	{page:Section1;}
-->
</style>

</head>

<body lang=3DZH-CN link=3Dblue vlink=3Dpurple style=3D'text-justify-trim:pu=
nctuation'>

<div class=3DSection1>

<p class=3DMsoNormal align=3Dleft style=3D'text-align:left;text-autospace:n=
one'><font
size=3D2 face=3DArial><span lang=3DEN-US style=3D'font-size:10.0pt;font-fam=
ily:Arial'>Hi
All,<o:p></o:p></span></font></p>

<p class=3DMsoNormal align=3Dleft style=3D'text-align:left;text-autospace:n=
one'><font
size=3D2 face=3DArial><span lang=3DEN-US style=3D'font-size:10.0pt;font-fam=
ily:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal align=3Dleft style=3D'text-align:left;text-autospace:n=
one'><font
size=3D2 face=3DArial><span lang=3DEN-US style=3D'font-size:10.0pt;font-fam=
ily:Arial'>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 reques=
ts.
However, if we start wpa_supplicant to control two interfaces and one of th=
em
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.<o:p></o:p></span></font></p>

<p class=3DMsoNormal align=3Dleft style=3D'text-align:left;text-autospace:n=
one'><font
size=3D2 face=3DArial><span lang=3DEN-US style=3D'font-size:10.0pt;font-fam=
ily:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal align=3Dleft style=3D'text-align:left;text-autospace:n=
one'><font
size=3D2 face=3DArial><span lang=3DEN-US style=3D'font-size:10.0pt;font-fam=
ily:Arial'>Any
comments are appreciated, thanks a lot.<o:p></o:p></span></font></p>

<p class=3DMsoNormal align=3Dleft style=3D'text-align:left;text-autospace:n=
one'><font
size=3D2 face=3DArial><span lang=3DEN-US style=3D'font-size:10.0pt;font-fam=
ily:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal align=3Dleft style=3D'text-align:left;text-autospace:n=
one'><font
size=3D2 face=3DArial><span lang=3DEN-US style=3D'font-size:10.0pt;font-fam=
ily:Arial'>From
c5336ef55d4fc05396c68aeec16ba427d8c8941e Mon Sep 17 00:00:00 2001<o:p></o:p=
></span></font></p>

<p class=3DMsoNormal align=3Dleft style=3D'text-align:left;text-autospace:n=
one'><font
size=3D2 face=3DArial><span lang=3DEN-US style=3D'font-size:10.0pt;font-fam=
ily:Arial'>From:
Stone Piao &lt;piaoyun at marvell.com&gt;<o:p></o:p></span></font></p>

<p class=3DMsoNormal align=3Dleft style=3D'text-align:left;text-autospace:n=
one'><font
size=3D2 face=3DArial><span lang=3DEN-US style=3D'font-size:10.0pt;font-fam=
ily:Arial'>Date:
Wed, 24 Oct 2012 13:52:58 -0400<o:p></o:p></span></font></p>

<p class=3DMsoNormal align=3Dleft style=3D'text-align:left;text-autospace:n=
one'><font
size=3D2 face=3DArial><span lang=3DEN-US style=3D'font-size:10.0pt;font-fam=
ily:Arial'>Subject:
[PATCH] P2P: Do not append WPS and P2P IE for the interface not support P2P=
<o:p></o:p></span></font></p>

<p class=3DMsoNormal align=3Dleft style=3D'text-align:left;text-autospace:n=
one'><font
size=3D2 face=3DArial><span lang=3DEN-US style=3D'font-size:10.0pt;font-fam=
ily:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal align=3Dleft style=3D'text-align:left;text-autospace:n=
one'><font
size=3D2 face=3DArial><span lang=3DEN-US style=3D'font-size:10.0pt;font-fam=
ily:Arial'>When
start one wpa_supplicant to control two interfaces and the first one is onl=
y
supports WPS and the other one supports both WPS and P2P, we should not app=
end
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 th=
e
time.<o:p></o:p></span></font></p>

<p class=3DMsoNormal align=3Dleft style=3D'text-align:left;text-autospace:n=
one'><font
size=3D2 face=3DArial><span lang=3DEN-US style=3D'font-size:10.0pt;font-fam=
ily:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal align=3Dleft style=3D'text-align:left;text-autospace:n=
one'><font
size=3D2 face=3DArial><span lang=3DEN-US style=3D'font-size:10.0pt;font-fam=
ily:Arial'>Signed-off-by:
Stone Piao &lt;piaoyun at marvell.com&gt;<o:p></o:p></span></font></p>

<p class=3DMsoNormal align=3Dleft style=3D'text-align:left;text-autospace:n=
one'><font
size=3D2 face=3DArial><span lang=3DEN-US style=3D'font-size:10.0pt;font-fam=
ily:Arial'>---<o:p></o:p></span></font></p>

<p class=3DMsoNormal align=3Dleft style=3D'text-align:left;text-autospace:n=
one'><font
size=3D2 face=3DArial><span lang=3DEN-US style=3D'font-size:10.0pt;font-fam=
ily:Arial'>&nbsp;wpa_supplicant/scan.c
|&nbsp;&nbsp;&nbsp; 3 ++-<o:p></o:p></span></font></p>

<p class=3DMsoNormal align=3Dleft style=3D'text-align:left;text-autospace:n=
one'><font
size=3D2 face=3DArial><span lang=3DEN-US style=3D'font-size:10.0pt;font-fam=
ily:Arial'>&nbsp;1
files changed, 2 insertions(+), 1 deletions(-)<o:p></o:p></span></font></p>

<p class=3DMsoNormal align=3Dleft style=3D'text-align:left;text-autospace:n=
one'><font
size=3D2 face=3DArial><span lang=3DEN-US style=3D'font-size:10.0pt;font-fam=
ily:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal align=3Dleft style=3D'text-align:left;text-autospace:n=
one'><font
size=3D2 face=3DArial><span lang=3DEN-US style=3D'font-size:10.0pt;font-fam=
ily:Arial'>diff
--git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index 68bdc59..59c786=
4
100644<o:p></o:p></span></font></p>

<p class=3DMsoNormal align=3Dleft style=3D'text-align:left;text-autospace:n=
one'><font
size=3D2 face=3DArial><span lang=3DEN-US style=3D'font-size:10.0pt;font-fam=
ily:Arial'>---
a/wpa_supplicant/scan.c<o:p></o:p></span></font></p>

<p class=3DMsoNormal align=3Dleft style=3D'text-align:left;text-autospace:n=
one'><font
size=3D2 face=3DArial><span lang=3DEN-US style=3D'font-size:10.0pt;font-fam=
ily:Arial'>+++
b/wpa_supplicant/scan.c<o:p></o:p></span></font></p>

<p class=3DMsoNormal align=3Dleft style=3D'text-align:left;text-autospace:n=
one'><font
size=3D2 face=3DArial><span lang=3DEN-US style=3D'font-size:10.0pt;font-fam=
ily:Arial'>@@
-66,7 +66,8 @@ static int wpas_wps_in_use(struct wpa_supplicant *wpa_s,<o:p=
></o:p></span></font></p>

<p class=3DMsoNormal align=3Dleft style=3D'text-align:left;text-autospace:n=
one'><font
size=3D2 face=3DArial><span lang=3DEN-US style=3D'font-size:10.0pt;font-fam=
ily:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<o:p></o:p></span></font></p>

<p class=3DMsoNormal align=3Dleft style=3D'text-align:left;text-autospace:n=
one'><font
size=3D2 face=3DArial><span lang=3DEN-US style=3D'font-size:10.0pt;font-fam=
ily:Arial'>&nbsp;<o:p></o:p></span></font></p>

<p class=3DMsoNormal align=3Dleft style=3D'text-align:left;text-autospace:n=
one'><font
size=3D2 face=3DArial><span lang=3DEN-US style=3D'font-size:10.0pt;font-fam=
ily:Arial'>&nbsp;#ifdef
CONFIG_P2P<o:p></o:p></span></font></p>

<p class=3DMsoNormal align=3Dleft style=3D'text-align:left;text-autospace:n=
one'><font
size=3D2 face=3DArial><span lang=3DEN-US style=3D'font-size:10.0pt;font-fam=
ily:Arial'>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if
(!wpa_s-&gt;global-&gt;p2p_disabled &amp;&amp; wpa_s-&gt;global-&gt;p2p
&amp;&amp;<o:p></o:p></span></font></p>

<p class=3DMsoNormal align=3Dleft style=3D'text-align:left;text-autospace:n=
one'><font
size=3D2 face=3DArial><span lang=3DEN-US style=3D'font-size:10.0pt;font-fam=
ily:Arial'>+&nbsp;&nbsp;&nbsp;&nbsp; if
(wpa_s-&gt;drv_flags &amp; WPA_DRIVER_FLAGS_P2P_CAPABLE &amp;&amp;<o:p></o:=
p></span></font></p>

<p class=3DMsoNormal align=3Dleft style=3D'text-align:left;text-autospace:n=
one'><font
size=3D2 face=3DArial><span lang=3DEN-US style=3D'font-size:10.0pt;font-fam=
ily:Arial'>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp; !wpa_s-&gt;global-&gt;p2p_disabled
&amp;&amp; wpa_s-&gt;global-&gt;p2p &amp;&amp;<o:p></o:p></span></font></p>

<p class=3DMsoNormal align=3Dleft style=3D'text-align:left;text-autospace:n=
one'><font
size=3D2 face=3DArial><span lang=3DEN-US style=3D'font-size:10.0pt;font-fam=
ily:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
!wpa_s-&gt;conf-&gt;p2p_disabled) {<o:p></o:p></span></font></p>

<p class=3DMsoNormal align=3Dleft style=3D'text-align:left;text-autospace:n=
one'><font
size=3D2 face=3DArial><span lang=3DEN-US style=3D'font-size:10.0pt;font-fam=
ily:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp; wpa_s-&gt;wps-&gt;dev.p2p
=3D 1;<o:p></o:p></span></font></p>

<p class=3DMsoNormal align=3Dleft style=3D'text-align:left;text-autospace:n=
one'><font
size=3D2 face=3DArial><span lang=3DEN-US style=3D'font-size:10.0pt;font-fam=
ily:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp; if
(!wps) {<o:p></o:p></span></font></p>

<p class=3DMsoNormal align=3Dleft style=3D'text-align:left;text-autospace:n=
one'><font
size=3D2 face=3DArial><span lang=3DEN-US style=3D'font-size:10.0pt;font-fam=
ily:Arial'>--<o:p></o:p></span></font></p>

<p class=3DMsoNormal align=3Dleft style=3D'text-align:left;text-autospace:n=
one'><font
size=3D2 face=3DArial><span lang=3DEN-US style=3D'font-size:10.0pt;font-fam=
ily:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D1 face=3DArial><span lang=3DEN-US style=
=3D'font-size:
9.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

</div>

</body>

</html>

--_000_E62404B31D39064FBDD0B843ADF05A7D2D39A02374SCVEXCH4marve_--


More information about the HostAP mailing list