[PATCH] hostapd: fix pbc config method of WSC IE in beacon
Jouni Malinen
j
Mon Jun 25 02:24:07 PDT 2012
On Mon, Jun 25, 2012 at 09:32:04AM +0300, Yoni Divinsky wrote:
> 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.
Thanks, applied with a similar changes in the following condition:
> diff --git 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))) {
That last if statement is used to enforce WSC 2.0 compliant value and
while it may not really hit in practice due to other workaround
implementation in configuration, it would be good to keep this
consistent with the first two if statements. As such, I changed it to
follow the same style to check the multi-bit defines.
--
Jouni Malinen PGP id EFC895FA
More information about the Hostap
mailing list