[PATCH] hostapd: fix pbc config method of WSC IE in beacon

Yoni Divinsky yoni.divinsky
Sun Jun 24 23:32:04 PDT 2012


In softAP which supports WPSv2 with only virtual push
button, when PBC is called, the WSC IE should include
selected Registrar Configuration Methods attribute
with the bit of the physical push button no set.

Signed-hostap: Yoni Divinsky <yoni.divinsky at ti.com>
---
 src/wps/wps_registrar.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/wps/wps_registrar.c b/src/wps/wps_registrar.c
index e6ec04c..3b53ce8 100644
--- a/src/wps/wps_registrar.c
+++ b/src/wps/wps_registrar.c
@@ -480,9 +480,11 @@ static void wps_set_pushbutton(u16 *methods, u16 conf_methods)
 {
 	*methods |= WPS_CONFIG_PUSHBUTTON;
 #ifdef CONFIG_WPS2
-	if (conf_methods & WPS_CONFIG_VIRT_PUSHBUTTON)
+	if ((conf_methods & WPS_CONFIG_VIRT_PUSHBUTTON) ==
+	    WPS_CONFIG_VIRT_PUSHBUTTON)
 		*methods |= WPS_CONFIG_VIRT_PUSHBUTTON;
-	if (conf_methods & WPS_CONFIG_PHY_PUSHBUTTON)
+	if ((conf_methods & WPS_CONFIG_PHY_PUSHBUTTON) ==
+	    WPS_CONFIG_PHY_PUSHBUTTON)
 		*methods |= WPS_CONFIG_PHY_PUSHBUTTON;
 	if (!(*methods & (WPS_CONFIG_VIRT_PUSHBUTTON |
 			  WPS_CONFIG_PHY_PUSHBUTTON))) {
-- 
1.7.0.4




More information about the Hostap mailing list